mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
Add: - FunctionBody - Program - ProgramParameterDeclaration - ProgramParameterList Build AST for program sections and generate code for it
28 lines
765 B
C++
28 lines
765 B
C++
#include "ProgramParameterDeclaration.h"
|
|
|
|
#include <format/format.h>
|
|
#include <utility>
|
|
|
|
#include "compiler/ast/NodeVisitor.h"
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
{
|
|
ProgramParameterDeclaration::ProgramParameterDeclaration( const SourceLocation& source_location,
|
|
std::string name, bool unused )
|
|
: Node( source_location ), name( std::move( name ) ), unused( unused )
|
|
{
|
|
}
|
|
void ProgramParameterDeclaration::accept( NodeVisitor& visitor )
|
|
{
|
|
visitor.visit_program_parameter_declaration( *this );
|
|
}
|
|
|
|
void ProgramParameterDeclaration::describe_to( fmt::Writer& w ) const
|
|
{
|
|
w << "program-parameter-declaration(" << name;
|
|
if ( unused )
|
|
w << ", unused";
|
|
w << ")";
|
|
}
|
|
|
|
} // namespace Pol::Bscript::Compiler
|