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;
|
||||
for ( cfi = 0 ; cfi < output->root.nFunctions( ) ; cfi ++ ) {
|
||||
auto& function( output->root.function( cfi ) );
|
||||
visitor.visit( function ,
|
||||
[&]( A_Node& n , const bool exit ) -> bool {
|
||||
visitor.visit( function , [&]( A_Node& n , const bool exit ) -> bool {
|
||||
if ( exit ) {
|
||||
return true;
|
||||
}
|
||||
|
@ -701,6 +700,9 @@ bool T_ParserImpl_::checkIdentifierExpressions( ) noexcept
|
|||
esb << "'" << e.id( ) << "' used as input but declared as a "
|
||||
<< *t;
|
||||
errors.addNew( std::move( esb ) , e.idLocation( ) );
|
||||
} else if ( callInfo[ cfi ] & E_InstrRestriction::INIT ) {
|
||||
errors.addNew( "input used in initialisation" ,
|
||||
e.location( ) );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue