mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
JSSpecCompiler: Parse enumerators in xspec mode
This commit is contained in:
committed by
Andrew Kaster
parent
3d365326af
commit
990e30f458
@@ -40,6 +40,16 @@ FunctionDeclarationRef TranslationUnit::find_declaration_by_name(StringView name
|
||||
return it->value;
|
||||
}
|
||||
|
||||
EnumeratorRef TranslationUnit::get_node_for_enumerator_value(StringView value)
|
||||
{
|
||||
if (auto it = m_enumerator_nodes.find(value); it != m_enumerator_nodes.end())
|
||||
return it->value;
|
||||
|
||||
auto enumerator = NonnullRefPtr(NonnullRefPtr<Enumerator>::Adopt, *new Enumerator { {}, value });
|
||||
m_enumerator_nodes.set(value, enumerator);
|
||||
return enumerator;
|
||||
}
|
||||
|
||||
FunctionDeclaration::FunctionDeclaration(StringView name, Vector<FunctionArgument>&& arguments)
|
||||
: m_name(name)
|
||||
, m_arguments(arguments)
|
||||
|
||||
Reference in New Issue
Block a user