20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
-
+
|
// Parse a sequence of expression. Each expression is
// a statement.
void Parser::parseSequence()
{
for(;;)
{
CodeBuilder::LifetimeScopeGuard lsg( context() );
LifetimeScopeGuard lsg( context() );
{
// Each statement gets its own visibility scope,
// so that vars defined inside of the statement are only
// visible from within it.
// However, they also have a lifetime scope, which
// is separate because we need to flush the value
|
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
-
-
+
+
|
if( !parseInfix( next->first, *prec ) )
break;
}
}
void Parser::flushValue()
{
const auto& cb = context().codeBuilder();
if( m_lastValue && cb && cb->cfg() && ( !cb->cfg()->currentBB() || cb->cfg()->currentBB()->terminator() ) )
auto cfg = GetCFG( context() );
if( m_lastValue && cfg && ( !cfg->currentBB() || cfg->currentBB()->terminator() ) )
{
DiagnosticsManager::GetInstance().emitSyntaxErrorMessage(
m_lastValue->locationId(), "unreachable code.", 0 );
}
// Flush the pending value, by invoking the DropValue
// extension point, where an overload will decide
|