polserver/pol-core/bscript/compiler/ast/Identifier.cpp
turleypol 1463b76c7c
Includes are now all relative to pol-core basefolder (#906)
* all except pol

* pol and includes under defines

* something weird has happened

* remove own folder from include searchpath

* fixed remaining, adapted include style for external headers

* missing include
2026-07-25 23:01:18 +02:00

38 lines
839 B
C++

#include "bscript/compiler/ast/Identifier.h"
#include "bscript/compiler/ast/NodeVisitor.h"
namespace Pol::Bscript::Compiler
{
Identifier::Identifier( const SourceLocation& loc, const ScopableName& scoped_name )
: Expression( loc ), scoped_name( scoped_name )
{
}
Identifier::Identifier( const SourceLocation& loc, const std::string& name )
: Identifier( loc, ScopableName( ScopeName::None, name ) )
{
}
void Identifier::accept( NodeVisitor& visitor )
{
visitor.visit_identifier( *this );
}
void Identifier::describe_to( std::string& w ) const
{
fmt::format_to( std::back_inserter( w ), "identifier({})", scoped_name.string() );
}
std::string Identifier::string() const
{
return scoped_name.string();
}
const std::string& Identifier::name() const
{
return scoped_name.name;
}
} // namespace Pol::Bscript::Compiler