diff --git a/gcc/cobol/parse_ante.h b/gcc/cobol/parse_ante.h index 422567fa252352ebc36c79387b4404daad85156e..a799aa0a5e1e6b0d286e1d249a31c0c0785c05ca 100644 --- a/gcc/cobol/parse_ante.h +++ b/gcc/cobol/parse_ante.h @@ -2136,6 +2136,8 @@ static class current_t { return symbol_index(symbol_elem_of(section)); } + bool doing_declaratives() const { return in_declaratives; } + cbl_label_t *doing_declaratives( bool begin ) { if( begin ) { in_declaratives = true; @@ -3598,7 +3600,7 @@ static size_t statement_begin( const YYLTYPE& loc, int token ); static void ast_first_statement( int first_line ) { static bool first = true; - if( first ) { + if( first && ! current.doing_declaratives() ) { parser_first_statement(first_line); first = false; }