diff --git a/gcc/cobol/failures/playpen/playpen.cbl b/gcc/cobol/failures/playpen/playpen.cbl index 056d00690d625a1f9d23b9691dd92f6f9038a2fb..0670d3bcba5c91b90acc4a87f35d72d63e267365 100644 --- a/gcc/cobol/failures/playpen/playpen.cbl +++ b/gcc/cobol/failures/playpen/playpen.cbl @@ -1,17 +1,10 @@ - identification division. - program-id. prog. - procedure division. - display "about to perform stuff" - perform stuff - display "line 1 after perform" - display "line 2 after perform" - display "line 3 after perform". - stuff. - display "This is paragraph ""stuff1""". - display "This is paragraph ""stuff2""". - display "This is paragraph ""stuff3""". - display "This is paragraph ""stuff4""". - endstuff. - display "That's all, folks!" - goback. - end program prog. +1 identification division. +2 program-id. prog. +3 procedure division. +4 +5 +6 display "Hello" +7 +8 +9 goback. +10 end program prog. diff --git a/gcc/cobol/genapi.cc b/gcc/cobol/genapi.cc index 51a06bf0aff1b9bb108def4919dbe6d076460cb7..1eefb7094ce76016f38a37bf26d91bdcdfd5e98c 100644 --- a/gcc/cobol/genapi.cc +++ b/gcc/cobol/genapi.cc @@ -50,6 +50,8 @@ #include "show_parse.h" #include "util.h" +extern int yylineno; + #define TSI_BACK (tsi_last(current_function->statement_list_stack.back())) static std::unordered_map<std::string, std::string> main_strings; @@ -880,13 +882,15 @@ void parser_statement_begin() SHOW_PARSE_HEADER char ach[64]; snprintf (ach, sizeof(ach), - " first/last %d/%d", + " yylineno %d first/last %d/%d", + yylineno, cobol_location().first_line, cobol_location().last_line ); SHOW_PARSE_TEXT(ach); SHOW_PARSE_END } + if( gg_get_current_line_number() == DEFAULT_LINE_NUMBER ) { // This code is prevents anomolies when the first line of a program is @@ -2911,8 +2915,6 @@ parser_goto( cbl_refer_t value_ref, size_t narg, cbl_label_t * const labels[] ) return; } -extern int yylineno; - void parser_perform(cbl_label_t *label, bool suppress_nexting) {