2026-07-25 23:01:18 +02:00
|
|
|
#include "bscript/compiler/ast/DictionaryEntry.h"
|
2020-09-06 04:02:37 -07:00
|
|
|
|
|
|
|
|
|
2021-02-25 16:53:22 +01:00
|
|
|
#include "bscript/compiler/ast/Expression.h"
|
|
|
|
|
#include "bscript/compiler/ast/NodeVisitor.h"
|
2020-09-06 04:02:37 -07:00
|
|
|
|
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
|
|
|
{
|
|
|
|
|
DictionaryEntry::DictionaryEntry( const SourceLocation& source_location,
|
|
|
|
|
std::unique_ptr<Expression> key,
|
|
|
|
|
std::unique_ptr<Expression> value )
|
|
|
|
|
: Node( source_location )
|
|
|
|
|
{
|
|
|
|
|
children.reserve( 2 );
|
|
|
|
|
children.push_back( std::move( key ) );
|
|
|
|
|
children.push_back( std::move( value ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DictionaryEntry::accept( NodeVisitor& visitor )
|
|
|
|
|
{
|
|
|
|
|
visitor.visit_dictionary_entry( *this );
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-12 06:51:44 +01:00
|
|
|
void DictionaryEntry::describe_to( std::string& w ) const
|
2020-09-06 04:02:37 -07:00
|
|
|
{
|
2024-01-12 06:51:44 +01:00
|
|
|
w += "dictionary-entry";
|
2020-09-06 04:02:37 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Pol::Bscript::Compiler
|