1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 19:34:59 +00:00
serenity/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/Function.cpp
Dan Klishch 81519975c5 JSSpecCompiler: Add reference resolving pass
It replaces UnresolvedReference with Variable, FunctionPointer, or
SlotName nodes. Also, it gathers all variable names from their
declarations.
2023-09-17 16:04:42 -06:00

20 lines
404 B
C++

/*
* Copyright (c) 2023, Dan Klishch <danilklishch@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "Function.h"
#include "AST/AST.h"
namespace JSSpecCompiler {
Function::Function(ExecutionContext* context, StringView name, Tree ast)
: m_context(context)
, m_name(name)
, m_ast(move(ast))
, m_return_value(make_ref_counted<VariableDeclaration>("$return"sv))
{
}
}