mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:58:11 +00:00
JSSpecCompiler: Parse enumerators in xspec mode
This commit is contained in:
parent
3d365326af
commit
990e30f458
13 changed files with 69 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue