|
|
@ -70,6 +70,9 @@ std::pair<std::string_view, Token> nextToken(std::string_view sv)
|
|
|
|
return {extractName(sv.substr(1)), Token::PushVar};
|
|
|
|
return {extractName(sv.substr(1)), Token::PushVar};
|
|
|
|
} else if (isdigit(ch) || (ch == '-' && sv.size() > 1 && isdigit(sv[1]))) {
|
|
|
|
} else if (isdigit(ch) || (ch == '-' && sv.size() > 1 && isdigit(sv[1]))) {
|
|
|
|
return {extractName(sv), Token::Number};
|
|
|
|
return {extractName(sv), Token::Number};
|
|
|
|
|
|
|
|
} else if (ch == '\\' && sv.size() > 1) {
|
|
|
|
|
|
|
|
name = std::to_string(static_cast<int>(sv[1]));
|
|
|
|
|
|
|
|
return {sv.substr(2), Token::Number};
|
|
|
|
} else if (isname(ch)) {
|
|
|
|
} else if (isname(ch)) {
|
|
|
|
return {extractName(sv), Token::Var};
|
|
|
|
return {extractName(sv), Token::Var};
|
|
|
|
}
|
|
|
|
}
|
|
|
|