2026-07-25 23:01:18 +02:00
|
|
|
#include "bscript/compiler/ast/ProgramParameterDeclaration.h"
|
2020-08-28 22:45:07 -07:00
|
|
|
|
2024-01-16 17:55:42 +01:00
|
|
|
|
2020-08-28 22:45:07 -07:00
|
|
|
#include <utility>
|
|
|
|
|
|
2021-02-25 16:53:22 +01:00
|
|
|
#include "bscript/compiler/ast/NodeVisitor.h"
|
2020-08-28 22:45:07 -07:00
|
|
|
|
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
|
|
|
{
|
|
|
|
|
ProgramParameterDeclaration::ProgramParameterDeclaration( const SourceLocation& source_location,
|
|
|
|
|
std::string name, bool unused )
|
2024-01-12 06:51:44 +01:00
|
|
|
: Node( source_location ), name( std::move( name ) ), unused( unused )
|
2020-08-28 22:45:07 -07:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
void ProgramParameterDeclaration::accept( NodeVisitor& visitor )
|
|
|
|
|
{
|
|
|
|
|
visitor.visit_program_parameter_declaration( *this );
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-12 06:51:44 +01:00
|
|
|
void ProgramParameterDeclaration::describe_to( std::string& w ) const
|
2020-08-28 22:45:07 -07:00
|
|
|
{
|
2024-01-12 06:51:44 +01:00
|
|
|
fmt::format_to( std::back_inserter( w ), "program-parameter-declaration({}", name );
|
2020-08-28 22:45:07 -07:00
|
|
|
if ( unused )
|
2024-01-12 06:51:44 +01:00
|
|
|
w += ", unused";
|
|
|
|
|
w += ")";
|
2020-08-28 22:45:07 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Pol::Bscript::Compiler
|