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
50 lines
No EOL
1.3 KiB
C++
50 lines
No EOL
1.3 KiB
C++
#include "bscript/compiler/ast/ElementAssignment.h"
|
|
|
|
|
|
#include "bscript/compiler/ast/ElementIndexes.h"
|
|
#include "bscript/compiler/ast/NodeVisitor.h"
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
{
|
|
ElementAssignment::ElementAssignment( const SourceLocation& source_location, bool consume,
|
|
std::unique_ptr<Expression> entity,
|
|
std::unique_ptr<ElementIndexes> indexes,
|
|
std::unique_ptr<Expression> rhs )
|
|
: Expression( source_location ), consume( consume )
|
|
{
|
|
children.reserve( 3 );
|
|
children.push_back( std::move( entity ) );
|
|
children.push_back( std::move( indexes ) );
|
|
children.push_back( std::move( rhs ) );
|
|
}
|
|
|
|
void ElementAssignment::accept( NodeVisitor& visitor )
|
|
{
|
|
visitor.visit_element_assignment( *this );
|
|
}
|
|
void ElementAssignment::describe_to( std::string& w ) const
|
|
{
|
|
w += "element-assignment";
|
|
}
|
|
|
|
ElementIndexes& ElementAssignment::indexes()
|
|
{
|
|
return child<ElementIndexes>( 1 );
|
|
}
|
|
|
|
std::unique_ptr<Expression> ElementAssignment::take_entity()
|
|
{
|
|
return take_child<Expression>( 0 );
|
|
}
|
|
|
|
std::unique_ptr<ElementIndexes> ElementAssignment::take_indexes()
|
|
{
|
|
return take_child<ElementIndexes>( 1 );
|
|
}
|
|
|
|
std::unique_ptr<Expression> ElementAssignment::take_rhs()
|
|
{
|
|
return take_child<Expression>( 2 );
|
|
}
|
|
|
|
} // namespace Pol::Bscript::Compiler
|