2020-08-25 00:57:03 -07:00
|
|
|
#include "Identifier.h"
|
|
|
|
|
|
|
|
|
|
|
2021-02-25 16:53:22 +01:00
|
|
|
#include "bscript/compiler/ast/NodeVisitor.h"
|
2020-08-25 00:57:03 -07:00
|
|
|
|
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
|
|
|
{
|
|
|
|
|
Identifier::Identifier( const SourceLocation& source_location, std::string name )
|
|
|
|
|
: Expression( source_location ), name( std::move( name ) )
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Identifier::accept( NodeVisitor& visitor )
|
|
|
|
|
{
|
|
|
|
|
visitor.visit_identifier( *this );
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-12 06:51:44 +01:00
|
|
|
void Identifier::describe_to( std::string& w ) const
|
2020-08-25 00:57:03 -07:00
|
|
|
{
|
2024-01-12 06:51:44 +01:00
|
|
|
fmt::format_to( std::back_inserter( w ), "identifier({})", name );
|
2020-08-25 00:57:03 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Pol::Bscript::Compiler
|