1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 16:55:09 +00:00

JSSpecCompiler: Parse enumerators in xspec mode

This commit is contained in:
Dan Klishch 2024-01-20 22:10:07 -05:00 committed by Andrew Kaster
parent 3d365326af
commit 990e30f458
13 changed files with 69 additions and 0 deletions

View file

@ -316,6 +316,8 @@ TextParseErrorOr<Tree> TextParser::parse_expression()
}
}
VERIFY(expression);
} else if (token.type == TokenType::Enumerator) {
expression = m_ctx.translation_unit()->get_node_for_enumerator_value(token.data);
} else if (token.type == TokenType::Number) {
expression = make_ref_counted<MathematicalConstant>(MUST(Crypto::BigFraction::from_string(token.data)));
} else if (token.type == TokenType::String) {