Parse a number (sequence of digits)
| 77 | |
| 78 | // Parse a number (sequence of digits) |
| 79 | Token Tokenizer::ParseNumber() { |
| 80 | auto start = _position; |
| 81 | while (_position < static_cast<int>(_query.size()) && std::isdigit(_query[_position])) { |
| 82 | ++_position; |
| 83 | } |
| 84 | auto value = _query.substr(start, _position - start); |
| 85 | return {TokenType::NUMBER, value}; |
| 86 | } |
| 87 | |
| 88 | // Parse a parenthesis |
| 89 | Token Tokenizer::ParseParenthesis() { |