polserver/pol-core/bscript/compiler/ast/ProgramParameterDeclaration.cpp
Eric Swanson 5e57733a68
New compiler: program declarations (#246)
Add:
- FunctionBody
- Program
- ProgramParameterDeclaration
- ProgramParameterList

Build AST for program sections and generate code for it
2020-08-28 22:45:07 -07:00

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