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

JSSpecCompiler: Introduce Function and ExecutionContext classes

Currently, they are not extremely useful, but the plan is to store
all function-local state in JSSpecCompiler::Function and all
"translation unit" state in ExecutionContext.
This commit is contained in:
Dan Klishch 2023-08-20 14:05:48 -04:00 committed by Andrew Kaster
parent f05d291b41
commit cd8f4aaa7d
9 changed files with 74 additions and 9 deletions

View file

@ -103,11 +103,11 @@ ParseErrorOr<Algorithm> Algorithm::create(XML::Node const* node)
return algorithm;
}
ParseErrorOr<Function> Function::create(XML::Node const* element)
ParseErrorOr<SpecFunction> SpecFunction::create(XML::Node const* element)
{
VERIFY(element->as_element().name == tag_emu_clause);
Function result;
SpecFunction result;
result.m_id = TRY(get_attribute_by_name(element, attribute_id));
result.m_name = TRY(get_attribute_by_name(element, attribute_aoid));
@ -156,7 +156,7 @@ ParseErrorOr<Function> Function::create(XML::Node const* element)
return result;
}
ParseErrorOr<void> Function::parse_definition(XML::Node const* element)
ParseErrorOr<void> SpecFunction::parse_definition(XML::Node const* element)
{
auto tokens = TRY(tokenize_tree(element));
TextParser parser(tokens.tokens, element);