mirror of
https://github.com/RGBCube/serenity
synced 2025-07-15 14:27:35 +00:00
JSSpecCompiler: Support Cpp::StringLiteral in C++ AST converter
This commit is contained in:
parent
d7b4dc2a6a
commit
c2c37de201
1 changed files with 7 additions and 0 deletions
|
@ -123,6 +123,12 @@ NullableTree CppASTConverter::convert_node(Cpp::NumericLiteral const& literal)
|
||||||
return make_ref_counted<MathematicalConstant>(literal.value().to_int<i64>().value());
|
return make_ref_counted<MathematicalConstant>(literal.value().to_int<i64>().value());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
NullableTree CppASTConverter::convert_node(Cpp::StringLiteral const& literal)
|
||||||
|
{
|
||||||
|
return make_ref_counted<StringLiteral>(literal.value());
|
||||||
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
NullableTree CppASTConverter::convert_node(Cpp::BinaryExpression const& expression)
|
NullableTree CppASTConverter::convert_node(Cpp::BinaryExpression const& expression)
|
||||||
{
|
{
|
||||||
|
@ -186,6 +192,7 @@ NullableTree CppASTConverter::as_nullable_tree(Cpp::Statement const* statement)
|
||||||
Cpp::BlockStatement,
|
Cpp::BlockStatement,
|
||||||
Cpp::AssignmentExpression,
|
Cpp::AssignmentExpression,
|
||||||
Cpp::NumericLiteral,
|
Cpp::NumericLiteral,
|
||||||
|
Cpp::StringLiteral,
|
||||||
Cpp::BinaryExpression>();
|
Cpp::BinaryExpression>();
|
||||||
|
|
||||||
if (result.has_value())
|
if (result.has_value())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue