/// <summary> /// 读取接下来的符号 /// </summary> /// <param name="symbol"></param> /// <param name="throwExceptionIfError"></param> /// <returns></returns> public bool ReadSymbol(string symbol, bool throwExceptionIfError) { // 跳过空格 while (char.IsWhiteSpace(this.Content[this.Index + this.Length])) { this.Length++; } if (throwExceptionIfError) { ParseException.Assert(this.Content.Substring(this.Index + this.Length, symbol.Length), symbol, this.Index); } else if (this.Content.Substring(this.Index + this.Length, symbol.Length) != symbol) { return(false); } this.Index += this.Length; this.Length = symbol.Length; return(true); }