polserver/pol-core/bscript/compiler/ast/JumpStatement.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

31 lines
861 B
C++

#include "bscript/compiler/ast/JumpStatement.h"
#include "bscript/compiler/ast/NodeVisitor.h"
namespace Pol::Bscript::Compiler
{
JumpStatement::JumpStatement( const SourceLocation& source_location, JumpType jump_type,
std::string label )
: Statement( source_location ),
jump_type( jump_type ),
label( std::move( label ) ),
flow_control_label(),
local_variables_to_remove( 0 )
{
}
void JumpStatement::accept( NodeVisitor& visitor )
{
visitor.visit_jump_statement( *this );
}
void JumpStatement::describe_to( std::string& w ) const
{
fmt::format_to( std::back_inserter( w ), "{}",
( jump_type == Break ? "break-statement" : "continue-statement" ) );
if ( !label.empty() )
fmt::format_to( std::back_inserter( w ), "({})", label );
}
} // namespace Pol::Bscript::Compiler