@ -176,12 +176,11 @@ namespace molasses {
throw expecting_token_error ( expected , context ) ; \
} } while ( false )
decltype ( it ) last_valid ;
decltype ( it ) last_valid = it ;
if ( * it ! = PROC_KW ) {
throw unexpected_token_error ( * it , tokens . dictionary [ * it ] , tokens . dictionary [ PROC_KW ] ) ;
}
last_valid = it ;
+ + it ;
check_for_unexpected_stream_end ( " Procedure-Name " , details : : concatenate_builder ( " In top level, file " , last_valid - > file_name , " : " , last_valid - > line , " : " , last_valid - > column ) ) ;
@ -227,8 +226,11 @@ namespace molasses {
if ( * ahead = = GOTO_KW ) {
found_gotos [ tokens . dictionary [ * it ] ] = body . size ( ) ;
} else if ( * ahead = = LABEL_KW ) {
found_labels [ tokens . dictionary [ * it ] ] = body . size ( ) ;
// TODO: Handle duplicate labels
auto label_value = tokens . dictionary [ * it ] ;
if ( found_labels . contains ( label_value ) ) {
throw duplicate_label_error ( * it , label_value ) ;
}
found_labels [ label_value ] = body . size ( ) ;
}
body . emplace_back ( * it ) ;
body . emplace_back ( * ahead ) ;