2026-07-25 23:01:18 +02:00
|
|
|
#include "bscript/compiler/analyzer/FlowControlScope.h"
|
2020-09-03 19:46:27 -07:00
|
|
|
|
2021-02-25 16:53:22 +01:00
|
|
|
#include "bscript/compiler/analyzer/FlowControlScopes.h"
|
|
|
|
|
#include "bscript/compiler/analyzer/Variables.h"
|
|
|
|
|
#include "bscript/compiler/model/FlowControlLabel.h"
|
2020-09-03 19:46:27 -07:00
|
|
|
|
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
|
|
|
{
|
|
|
|
|
FlowControlScope::FlowControlScope( FlowControlScopes& flow_control_scopes,
|
|
|
|
|
const SourceLocation& source_location, std::string name,
|
|
|
|
|
std::shared_ptr<FlowControlLabel> flow_control_label )
|
2024-01-12 06:51:44 +01:00
|
|
|
: source_location( source_location ),
|
|
|
|
|
name( std::move( name ) ),
|
|
|
|
|
flow_control_label( std::move( flow_control_label ) ),
|
|
|
|
|
local_variables_size( flow_control_scopes.local_variables.count() ),
|
|
|
|
|
parent_scope( flow_control_scopes.current_unnamed_scope ),
|
|
|
|
|
flow_control_scopes( flow_control_scopes )
|
2020-09-03 19:46:27 -07:00
|
|
|
{
|
|
|
|
|
flow_control_scopes.push( this );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FlowControlScope::~FlowControlScope()
|
|
|
|
|
{
|
|
|
|
|
flow_control_scopes.pop( this );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Pol::Bscript::Compiler
|