Parser - Errors when using inputs in initialisation
This commit is contained in:
parent
5d3aa32e9d
commit
773efeff54
1 changed files with 61 additions and 59 deletions
|
@ -685,8 +685,7 @@ bool T_ParserImpl_::checkIdentifierExpressions( ) noexcept
|
||||||
T_StringBuilder esb;
|
T_StringBuilder esb;
|
||||||
for ( cfi = 0 ; cfi < output->root.nFunctions( ) ; cfi ++ ) {
|
for ( cfi = 0 ; cfi < output->root.nFunctions( ) ; cfi ++ ) {
|
||||||
auto& function( output->root.function( cfi ) );
|
auto& function( output->root.function( cfi ) );
|
||||||
visitor.visit( function ,
|
visitor.visit( function , [&]( A_Node& n , const bool exit ) -> bool {
|
||||||
[&]( A_Node& n , const bool exit ) -> bool {
|
|
||||||
if ( exit ) {
|
if ( exit ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -701,6 +700,9 @@ bool T_ParserImpl_::checkIdentifierExpressions( ) noexcept
|
||||||
esb << "'" << e.id( ) << "' used as input but declared as a "
|
esb << "'" << e.id( ) << "' used as input but declared as a "
|
||||||
<< *t;
|
<< *t;
|
||||||
errors.addNew( std::move( esb ) , e.idLocation( ) );
|
errors.addNew( std::move( esb ) , e.idLocation( ) );
|
||||||
|
} else if ( callInfo[ cfi ] & E_InstrRestriction::INIT ) {
|
||||||
|
errors.addNew( "input used in initialisation" ,
|
||||||
|
e.location( ) );
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue