mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* 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
38 lines
839 B
C++
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
|