示例#1
0
        private void ReadChar()
        {
            if (_lastChar != null)
            {
                CurrentChar = _lastChar;
                _lastChar   = null;
                return;
            }

            CurrentChar   = LookAheadChar;
            LookAheadChar = _reader.Read();
        }
示例#2
0
 public ProxySourceReader(Stream stream)
 {
     _reader               = new SourceReader(stream);
     _updateLineAndCol     = false;
     _skipSpace            = false;
     _parsingStringLiteral = false;
     CurrentString         = "";
     CurrentChar           = null;
     _lastChar             = null;
     LookAheadChar         = _reader.Read();
     CurrentLine           = _reader.LastCursor.Line;
     CurrentColumn         = _reader.LastCursor.Column;
 }
示例#3
0
 /// <summary>
 /// Accept <see cref="ProxySourceReader.CurrentString">CurrentString</see>[..^1] as a valid token.
 /// Clear CurrentString, but keep the last char.
 /// </summary>
 public void AcceptToLastOne()
 {
     _updateLineAndCol = true;
     _skipSpace        = true;
     _lastChar         = new ExtendedChar(CurrentString[^ 1]);