mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-28 05:52:53 +00:00
JSSpecCompiler: Parse enumerators in xspec mode
This commit is contained in:
parent
3d365326af
commit
990e30f458
Notes:
sideshowbarker
2024-07-17 08:25:15 +09:00
Author: https://github.com/DanShaders
Commit: 990e30f458
Pull-request: https://github.com/SerenityOS/serenity/pull/23123
Reviewed-by: https://github.com/ADKaster ✅
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