public Token(LexerPosition start, LexerPosition end, TokenType type, object value) { StartPosition = start; EndPosition = end; TokenType = type; Value = value; if (value is string str) { StringValue = str; } if (value is int i) { IntValue = i; } if (value is double d) { DoubleValue = d; } }
private void ReadComment() { int position = _currentPosition; while ((++position) < _text.Length) { if (_text[position] == '\n' || _text[position] == '\r') { break; } } int diff = (position - _currentPosition); _currentPosition = position; _column += diff; CurrentTokenEnd = new LexerPosition(_line, _column - 1); _currentStringValue = null; _currentTokenType = TokenType.Comment; }
public GraphQueryParseException(string message, LexerPosition position) : base(message) { ErrorPosition = position; }
public GraphQueryLexerException(string message, LexerPosition lexerPosition) : base(message) { }