MCPcopy Create free account
hub / github.com/dais-polymtl/flock / ParseNumber

Method ParseNumber

src/custom_parser/tokenizer.cpp:79–86  ·  view source on GitHub ↗

Parse a number (sequence of digits)

Source from the content-addressed store, hash-verified

77
78// Parse a number (sequence of digits)
79Token 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
89Token Tokenizer::ParseParenthesis() {

Callers 1

TESTFunction · 0.80

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.64