#include "UnaryOperator.h" #include #include "bscript/compiler/ast/NodeVisitor.h" namespace Pol::Bscript::Compiler { UnaryOperator::UnaryOperator( const SourceLocation& source_location, std::string op, BTokenId token_id, std::unique_ptr operand ) : Expression( source_location, std::move( operand ) ), op( std::move( op ) ), token_id( token_id ) { } void UnaryOperator::accept( NodeVisitor& visitor ) { visitor.visit_unary_operator( *this ); } void UnaryOperator::describe_to( std::string& w ) const { fmt::format_to( std::back_inserter( w ), "unary-operator({})", op ); } Expression& UnaryOperator::operand() { return child( 0 ); } std::unique_ptr UnaryOperator::take_operand() { return take_child( 0 ); } } // namespace Pol::Bscript::Compiler