mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:18:11 +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:
parent
f05d291b41
commit
cd8f4aaa7d
9 changed files with 74 additions and 9 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <AK/TemporaryChange.h>
|
||||
|
||||
#include "AST/AST.h"
|
||||
#include "Function.h"
|
||||
|
||||
namespace JSSpecCompiler {
|
||||
|
||||
|
@ -131,7 +132,13 @@ void Variable::dump_tree(StringBuilder& builder)
|
|||
|
||||
void FunctionPointer::dump_tree(StringBuilder& builder)
|
||||
{
|
||||
dump_node(builder, "Func {}", m_function_name);
|
||||
m_function.visit(
|
||||
[&](StringView name) {
|
||||
dump_node(builder, "Func external \"{}\"", name);
|
||||
},
|
||||
[&](FunctionRef function) {
|
||||
dump_node(builder, "Func local \"{}\"", function->m_name);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue