From c2c37de2016380fa08c5eedbdeb5389e54d7614e Mon Sep 17 00:00:00 2001 From: Dan Klishch Date: Mon, 23 Oct 2023 17:41:34 -0400 Subject: [PATCH] JSSpecCompiler: Support Cpp::StringLiteral in C++ AST converter --- .../JSSpecCompiler/Parser/CppASTConverter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/Parser/CppASTConverter.cpp b/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/Parser/CppASTConverter.cpp index b63030be1b..b116a307ba 100644 --- a/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/Parser/CppASTConverter.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/Parser/CppASTConverter.cpp @@ -123,6 +123,12 @@ NullableTree CppASTConverter::convert_node(Cpp::NumericLiteral const& literal) return make_ref_counted(literal.value().to_int().value()); } +template<> +NullableTree CppASTConverter::convert_node(Cpp::StringLiteral const& literal) +{ + return make_ref_counted(literal.value()); +} + template<> NullableTree CppASTConverter::convert_node(Cpp::BinaryExpression const& expression) { @@ -186,6 +192,7 @@ NullableTree CppASTConverter::as_nullable_tree(Cpp::Statement const* statement) Cpp::BlockStatement, Cpp::AssignmentExpression, Cpp::NumericLiteral, + Cpp::StringLiteral, Cpp::BinaryExpression>(); if (result.has_value())