mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-18 15:32:22 +00:00
JSSpecCompiler: Parse true, false, this, undefined, and null
This commit is contained in:
parent
86d54a8684
commit
b800276347
Notes:
sideshowbarker
2024-07-16 21:45:42 +09:00
Author: https://github.com/DanShaders
Commit: b800276347
Pull-request: https://github.com/SerenityOS/serenity/pull/23123
Reviewed-by: https://github.com/ADKaster ✅
7 changed files with 70 additions and 3 deletions
|
@ -134,6 +134,11 @@ protected:
|
|||
class WellKnownNode : public Expression {
|
||||
public:
|
||||
enum Type {
|
||||
False,
|
||||
Null,
|
||||
This,
|
||||
True,
|
||||
Undefined,
|
||||
ZeroArgumentFunctionCall,
|
||||
// Update WellKnownNode::dump_tree after adding an entry here
|
||||
};
|
||||
|
|
|
@ -38,6 +38,11 @@ void ErrorNode::dump_tree(StringBuilder& builder)
|
|||
void WellKnownNode::dump_tree(StringBuilder& builder)
|
||||
{
|
||||
static constexpr StringView type_to_name[] = {
|
||||
"False"sv,
|
||||
"Null"sv,
|
||||
"This"sv,
|
||||
"True"sv,
|
||||
"Undefined"sv,
|
||||
"ZeroArgumentFunctionCall"sv,
|
||||
};
|
||||
dump_node(builder, "WellKnownNode {}", type_to_name[m_type]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue