diff --git a/gcc/cobol/UAT/testsuite.src/run_functions.at b/gcc/cobol/UAT/testsuite.src/run_functions.at index 46ccd18f054223d46cd08089d3ccb0568d528666..b1b7ce6bae5c344dfb25a360457bada0c78535d2 100644 --- a/gcc/cobol/UAT/testsuite.src/run_functions.at +++ b/gcc/cobol/UAT/testsuite.src/run_functions.at @@ -3414,13 +3414,10 @@ AT_DATA([prog.cob], [ AT_CHECK([$COMPILE prog.cob], [0], [], []) AT_CHECK([$COBCRUN_DIRECT ./a.out], [0], [], []) - AT_CLEANUP - AT_SETUP([FUNCTION YEAR-TO-YYYY]) AT_KEYWORDS([functions]) - AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. @@ -3435,10 +3432,66 @@ AT_DATA([prog.cob], [ END-IF. STOP RUN. ]) - AT_CHECK([$COMPILE prog.cob], [0], [], []) AT_CHECK([$COBCRUN_DIRECT ./a.out], [0], [], []) - AT_CLEANUP +AT_SETUP([UDF RETURNING group and PIC 9(5)]) +AT_KEYWORDS([functions]) +AT_DATA([prog.cob], [ + IDENTIFICATION DIVISION. + FUNCTION-ID. COPYPAR. + DATA DIVISION. + LINKAGE SECTION. + 01 PARSA. + 02 PAR1 PICTURE X(32). + 02 PAR2 PICTURE X(32). + 01 PARSB. + 02 PAR1 PICTURE X(32). + 02 PAR2 PICTURE X(32). + PROCEDURE DIVISION USING PARSA RETURNING PARSB. + MOVE PARSA TO PARSB + DISPLAY """" PARSB """" + GOBACK. + END FUNCTION COPYPAR. + IDENTIFICATION DIVISION. + FUNCTION-ID. COPYPAR2. + DATA DIVISION. + LINKAGE SECTION. + 01 PARSB PIC 99999. + 01 PAR5 PIC 99999. + PROCEDURE DIVISION USING PAR5 RETURNING PARSB. + MOVE PAR5 TO PARSB + DISPLAY PARSB + GOBACK. + END FUNCTION COPYPAR2. + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + ENVIRONMENT DIVISION. + CONFIGURATION SECTION. + REPOSITORY. + FUNCTION COPYPAR. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 PARS1. + 02 PAR1 PICTURE X(32) VALUE "Santa". + 02 PAR2 PICTURE X(32) VALUE "Claus". + 01 PARS2. + 02 PAR1 PICTURE X(32). + 02 PAR2 PICTURE X(32). + 01 PAR5 PICTURE 99999 VALUE 54321. + PROCEDURE DIVISION. + MOVE COPYPAR(PARS1) TO PARS2 + DISPLAY """" PARS2 """". + DISPLAY COPYPAR2(PAR5) + STOP RUN. + END PROGRAM prog. +]) +AT_CHECK([$COMPILE prog.cob], [0], [], []) +AT_CHECK([$COBCRUN_DIRECT ./a.out], [0], ["Santa Claus " +"Santa Claus " +54321 +54321 +], []) +AT_CLEANUP diff --git a/gcc/cobol/failures/copypar/Makefile b/gcc/cobol/failures/copypar/Makefile deleted file mode 100644 index f77e46b3451abf45cb70ed9dc161be56b3b063c7..0000000000000000000000000000000000000000 --- a/gcc/cobol/failures/copypar/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../Makefile.inc diff --git a/gcc/cobol/failures/copypar/input.txt b/gcc/cobol/failures/copypar/input.txt deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/gcc/cobol/failures/copypar/playpen.cbl b/gcc/cobol/failures/copypar/playpen.cbl deleted file mode 100644 index 4e09043e6f6255aaacc282d0e5c993b9deec5573..0000000000000000000000000000000000000000 --- a/gcc/cobol/failures/copypar/playpen.cbl +++ /dev/null @@ -1,52 +0,0 @@ - IDENTIFICATION DIVISION. - FUNCTION-ID. COPYPAR. - DATA DIVISION. - LINKAGE SECTION. - 01 PARSA. - 02 PAR1 PICTURE X(32). - 02 PAR2 PICTURE X(32). - 01 PARSB. - 02 PAR1 PICTURE X(32). - 02 PAR2 PICTURE X(32). - PROCEDURE DIVISION USING PARSA RETURNING PARSB. - MOVE PARSA TO PARSB - DISPLAY PARSB - GOBACK. - END FUNCTION COPYPAR. - - IDENTIFICATION DIVISION. - FUNCTION-ID. COPYPAR2. - DATA DIVISION. - LINKAGE SECTION. - 01 PARSB PIC 99999. - 01 PAR5 PIC 99999. - PROCEDURE DIVISION USING PAR5 RETURNING PARSB. - MOVE PAR5 TO PARSB - DISPLAY PARSB - GOBACK. - END FUNCTION COPYPAR2. - - IDENTIFICATION DIVISION. - PROGRAM-ID. prog. - ENVIRONMENT DIVISION. - CONFIGURATION SECTION. - REPOSITORY. - FUNCTION COPYPAR. - DATA DIVISION. - WORKING-STORAGE SECTION. - 01 PARS1. - 02 PAR1 PICTURE X(32) VALUE "Santa". - 02 PAR2 PICTURE X(32) VALUE "Claus". - 01 PARS2. - 02 PAR1 PICTURE X(32). - 02 PAR2 PICTURE X(32). - - 01 PAR5 PICTURE 99999 VALUE 54321. - PROCEDURE DIVISION. - MOVE COPYPAR(PARS1) TO PARS2 - DISPLAY PARS2. - - DISPLAY COPYPAR2(PAR5) - - STOP RUN. - END PROGRAM prog. diff --git a/gcc/cobol/parse.y b/gcc/cobol/parse.y index ac05b969dab37c93da96968835162ee2609b9497..8305febb654e06297d8da8f46048e13028769367 100644 --- a/gcc/cobol/parse.y +++ b/gcc/cobol/parse.y @@ -555,9 +555,10 @@ %printer { fprintf(yyo, "%s %s", refer_type_str($$), $$? $$->name() : "<none>"); } <refer> %printer { fprintf(yyo, "%s", $$? name_of($$) : "[omitted]"); } alloc_ret %printer { fprintf(yyo, "%s %s '%s' (%s)", - cbl_field_type_str($$->type), name_of($$), - $$->data.initial? $$->data.initial : "<nil>", - $$->value_str() ); } <field> + $$? cbl_field_type_str($$->type) : "<%empty>", + $$? name_of($$) : "", + $$? $$->data.initial? $$->data.initial : "<nil>" : "", + $$? $$->value_str() : "" ); } <field> %printer { fprintf(yyo, "%s {%c%s %s}", $$.cond->field->name, $$.ante.invert? '!' : ' ', @@ -9448,7 +9449,7 @@ keyword_str( int token ) { * Return the token for the Cobol name, unless it is a function name. The * lexer uses keyword_tok to determine if what appears to be a NAME is in fact * a token defined by the parser. For functions, the situation is unambiguous: - * a function name appears only after FUNCTION or in gthe REPOSITORY paragraph. + * a function name appears only after FUNCTION or in the REPOSITORY paragraph. * All function names are rejected here; the lexer uses typed_name to check * REPOSITORY names. */ diff --git a/gcc/cobol/parse_ante.h b/gcc/cobol/parse_ante.h index 65593f6f4c3af3bf4912ad36191f32d3510b49df..411cf1772b384ce2646addfa0a318240c7a6fc26 100644 --- a/gcc/cobol/parse_ante.h +++ b/gcc/cobol/parse_ante.h @@ -1841,18 +1841,17 @@ static inline cbl_field_t * new_temporary_clone( const cbl_field_t *orig) { cbl_field_type_t type = is_literal(orig)? FldAlphanumeric : orig->type; auto f = new_temporary_imply(type); - - // Dubner attempt at a true temporary clone - { - cbl_name_t tname; - memcpy(tname, f->name, sizeof(cbl_name_t)); + +// f->data = orig->data; +// if( orig->type == FldGroup) + { memcpy(f, orig, sizeof(cbl_field_t)); - memcpy(f->name, tname, sizeof(cbl_name_t)); +// namcpy(f->name, orig->name); f->attr = temporary_e; f->var_decl_node = NULL; f->data_decl_node = NULL; - } - f->data = orig->data; + } + parser_symbol_add(f); return f; } diff --git a/gcc/cobol/scan.l b/gcc/cobol/scan.l index a7ee009a4a48b65463a7c5f0c393bd5535d05cc9..69180099618364d71b61038fe8f673658f9e6df4 100644 --- a/gcc/cobol/scan.l +++ b/gcc/cobol/scan.l @@ -1515,116 +1515,128 @@ USE([[:space:]]+FOR)? { return USE; } } <function>{ - ABS { pop_return ABS; } - ACOS { pop_return ACOS; } - ANNUITY { pop_return ANNUITY; } - ASIN { pop_return ASIN; } - ATAN { pop_return ATAN; } - BIT-OF { pop_return BIT_OF; } - BIT-TO-CHAR { pop_return BIT_TO_CHAR; } - BYTE-LENGTH { pop_return BYTE_LENGTH; } - CHAR { pop_return CHAR; } - COMBINED-DATETIME { pop_return COMBINED_DATETIME; } - CONCAT { pop_return CONCAT; } - CONTENT-LENGTH { pop_return NO_CONDITION; /* GNU only*/ } - CONTENT-OF { pop_return NO_CONDITION; /* GNU only*/ } - COS { pop_return COS; } - CURRENCY-SYBOL { pop_return NO_CONDITION; /* GNU only*/ } - CURRENT-DATE { pop_return CURRENT_DATE; } - DATE-OF-INTEGER { pop_return DATE_OF_INTEGER; } - DATE-TO-YYYYMMDD { pop_return DATE_TO_YYYYMMDD; } - DAY-OF-INTEGER { pop_return DAY_OF_INTEGER; } - DAY-TO-YYYYDDD { pop_return DAY_TO_YYYYDDD; } - DISPLAY-OF { pop_return DISPLAY_OF; } - E { pop_return E; } - - EXCEPTION-FILE-N { pop_return EXCEPTION_FILE_N; } - EXCEPTION-FILE { pop_return EXCEPTION_FILE; } - EXCEPTION-LOCATION-N { pop_return EXCEPTION_LOCATION_N; } - EXCEPTION-LOCATION { pop_return EXCEPTION_LOCATION; } - EXCEPTION-STATEMENT { pop_return EXCEPTION_STATEMENT; } - EXCEPTION-STATUS { pop_return EXCEPTION_STATUS; } - - EXP { pop_return EXP; } - EXP10 { pop_return EXP10; } - FACTORIAL { pop_return FACTORIAL; } - - FORMATTED-CURRENT-DATE { BEGIN(datetime_fmt); return FORMATTED_CURRENT_DATE; } - FORMATTED-DATE { BEGIN(datetime_fmt); return FORMATTED_DATE; } - FORMATTED-DATETIME { BEGIN(datetime_fmt); return FORMATTED_DATETIME; } - FORMATTED-TIME { BEGIN(datetime_fmt); return FORMATTED_TIME; } - FRACTION-PART { pop_return FRACTION_PART; } - - HEX-OF { pop_return HEX_OF; } - HEX-TO-CHAR { pop_return HEX_TO_CHAR; } - HIGHEST-ALGEBRAIC { pop_return HIGHEST_ALGEBRAIC; } - - INTEGER { pop_return INTEGER; } - INTEGER-OF-DATE { pop_return INTEGER_OF_DATE; } - INTEGER-OF-DAY { pop_return INTEGER_OF_DAY; } - INTEGER-OF-FORMATTED-DATE { BEGIN(datetime_fmt); return INTEGER_OF_FORMATTED_DATE; } - INTEGER-PART { pop_return INTEGER_PART; } - LENGTH { pop_return LENGTH; } - LOCALE-COMPARE { pop_return LOCALE_COMPARE; } - LOCALE-DATE { pop_return LOCALE_DATE; } - LOCALE-TIME { pop_return LOCALE_TIME; } - LOCALE-TIME-FROM-SECONDS { pop_return LOCALE_TIME_FROM_SECONDS; } - LOG { pop_return LOG; } - LOG10 { pop_return LOG10; } - LOWER-CASE { pop_return LOWER_CASE; } - LOWEST-ALGEBRAIC { pop_return LOWEST_ALGEBRAIC; } - MAX { pop_return MAX; } - MEAN { pop_return MEAN; } - MEDIAN { pop_return MEDIAN; } - MIDRANGE { pop_return MIDRANGE; } - MIN { pop_return MIN; } - MOD { pop_return MOD; } - NATIONAL-OF { pop_return NATIONAL_OF; } - NUMVAL { pop_return NUMVAL; } - NUMVAL-C { pop_return NUMVAL_C; } - NUMVAL-F { pop_return NUMVAL_F; } - ORD { pop_return ORD; } - ORD-MAX { pop_return ORD_MAX; } - ORD-MIN { pop_return ORD_MIN; } - PI { pop_return PI; } - PRESENT-VALUE { pop_return PRESENT_VALUE; } - - RANDOM{OSPC}{PARENS} { pop_return RANDOM; } - RANDOM{OSPC}[(] { pop_return RANDOM_SEED; } - RANDOM { pop_return RANDOM; } - - RANGE { pop_return RANGE; } - REM { pop_return REM; } - REVERSE { pop_return REVERSE; } - SECONDS-FROM-FORMATTED-TIME { BEGIN(datetime_fmt); return SECONDS_FROM_FORMATTED_TIME; } - SECONDS-PAST-MIDNIGHT { pop_return SECONDS_PAST_MIDNIGHT; } - SIGN { pop_return SIGN; } - SIN { pop_return SIN; } - SQRT { pop_return SQRT; } - STANDARD-DEVIATION { pop_return STANDARD_DEVIATION; } - SUBSTITUTE { pop_return SUBSTITUTE; } - SUM { pop_return SUM; } - TAN { pop_return TAN; } - TEST-DATE-YYYYMMDD { pop_return TEST_DATE_YYYYMMDD; } - TEST-DAY-YYYYDDD { pop_return TEST_DAY_YYYYDDD; } - TEST-FORMATTED-DATETIME { BEGIN(datetime_fmt); return TEST_FORMATTED_DATETIME; } - TEST-NUMVAL { pop_return TEST_NUMVAL; } - TEST-NUMVAL-C { pop_return TEST_NUMVAL_C; } - TEST-NUMVAL-F { pop_return TEST_NUMVAL_F; } - TRIM { pop_return TRIM; } - ULENGTH { pop_return ULENGTH; } - UPOS { pop_return UPOS; } - UPPER-CASE { pop_return UPPER_CASE; } - USUBSTR { pop_return USUBSTR; } - USUPPLEMENTARY { pop_return USUPPLEMENTARY; } - UUID4 { pop_return UUID4; } - UVALID { pop_return UVALID; } - UWIDTH { pop_return UWIDTH; } - VARIANCE { pop_return VARIANCE; } - WHEN-COMPILED { pop_return WHEN_COMPILED; } - YEAR-TO-YYYY { pop_return YEAR_TO_YYYY; } - - {NAME} { pop_return NO_CONDITION; } + ABS{OSPC}/[(]? { pop_return ABS; } + ACOS{OSPC}/[(]? { pop_return ACOS; } + ANNUITY{OSPC}/[(]? { pop_return ANNUITY; } + ASIN{OSPC}/[(]? { pop_return ASIN; } + ATAN{OSPC}/[(]? { pop_return ATAN; } + BIT-OF{OSPC}/[(]? { pop_return BIT_OF; } + BIT-TO-CHAR{OSPC}/[(]? { pop_return BIT_TO_CHAR; } + BYTE-LENGTH{OSPC}/[(]? { pop_return BYTE_LENGTH; } + CHAR{OSPC}/[(]? { pop_return CHAR; } + COMBINED-DATETIME{OSPC}/[(]? { pop_return COMBINED_DATETIME; } + CONCAT{OSPC}/[(]? { pop_return CONCAT; } + CONTENT-LENGTH{OSPC}/[(]? { pop_return NO_CONDITION; /* GNU only*/ } + CONTENT-OF{OSPC}/[(]? { pop_return NO_CONDITION; /* GNU only*/ } + COS{OSPC}/[(]? { pop_return COS; } + CURRENCY-SYBOL{OSPC}/[(]? { pop_return NO_CONDITION; /* GNU only*/ } + CURRENT-DATE{OSPC}/[(]? { pop_return CURRENT_DATE; } + DATE-OF-INTEGER{OSPC}/[(]? { pop_return DATE_OF_INTEGER; } + DATE-TO-YYYYMMDD{OSPC}/[(]? { pop_return DATE_TO_YYYYMMDD; } + DAY-OF-INTEGER{OSPC}/[(]? { pop_return DAY_OF_INTEGER; } + DAY-TO-YYYYDDD{OSPC}/[(]? { pop_return DAY_TO_YYYYDDD; } + DISPLAY-OF{OSPC}/[(]? { pop_return DISPLAY_OF; } + E{OSPC}/[(]? { pop_return E; } + + EXCEPTION-FILE-N{OSPC}/[(]? { pop_return EXCEPTION_FILE_N; } + EXCEPTION-FILE{OSPC}/[(]? { pop_return EXCEPTION_FILE; } + EXCEPTION-LOCATION-N{OSPC}/[(]? { pop_return EXCEPTION_LOCATION_N; } + EXCEPTION-LOCATION{OSPC}/[(]? { pop_return EXCEPTION_LOCATION; } + EXCEPTION-STATEMENT{OSPC}/[(]? { pop_return EXCEPTION_STATEMENT; } + EXCEPTION-STATUS{OSPC}/[(]? { pop_return EXCEPTION_STATUS; } + + EXP{OSPC}/[(]? { pop_return EXP; } + EXP10{OSPC}/[(]? { pop_return EXP10; } + FACTORIAL{OSPC}/[(]? { pop_return FACTORIAL; } + + FORMATTED-CURRENT-DATE{OSPC}/[(]? { BEGIN(datetime_fmt); return FORMATTED_CURRENT_DATE; } + FORMATTED-DATE{OSPC}/[(]? { BEGIN(datetime_fmt); return FORMATTED_DATE; } + FORMATTED-DATETIME{OSPC}/[(]? { BEGIN(datetime_fmt); return FORMATTED_DATETIME; } + FORMATTED-TIME{OSPC}/[(]? { BEGIN(datetime_fmt); return FORMATTED_TIME; } + FRACTION-PART{OSPC}/[(]? { pop_return FRACTION_PART; } + + HEX-OF{OSPC}/[(]? { pop_return HEX_OF; } + HEX-TO-CHAR{OSPC}/[(]? { pop_return HEX_TO_CHAR; } + HIGHEST-ALGEBRAIC{OSPC}/[(]? { pop_return HIGHEST_ALGEBRAIC; } + + INTEGER{OSPC}/[(]? { pop_return INTEGER; } + INTEGER-OF-DATE{OSPC}/[(]? { pop_return INTEGER_OF_DATE; } + INTEGER-OF-DAY{OSPC}/[(]? { pop_return INTEGER_OF_DAY; } + INTEGER-OF-FORMATTED-DATE{OSPC}/[(]? { BEGIN(datetime_fmt); return INTEGER_OF_FORMATTED_DATE; } + INTEGER-PART{OSPC}/[(]? { pop_return INTEGER_PART; } + LENGTH{OSPC}/[(]? { pop_return LENGTH; } + LOCALE-COMPARE{OSPC}/[(]? { pop_return LOCALE_COMPARE; } + LOCALE-DATE{OSPC}/[(]? { pop_return LOCALE_DATE; } + LOCALE-TIME{OSPC}/[(]? { pop_return LOCALE_TIME; } + LOCALE-TIME-FROM-SECONDS{OSPC}/[(]? { pop_return LOCALE_TIME_FROM_SECONDS; } + LOG{OSPC}/[(]? { pop_return LOG; } + LOG10{OSPC}/[(]? { pop_return LOG10; } + LOWER-CASE{OSPC}/[(]? { pop_return LOWER_CASE; } + LOWEST-ALGEBRAIC{OSPC}/[(]? { pop_return LOWEST_ALGEBRAIC; } + MAX{OSPC}/[(]? { pop_return MAX; } + MEAN{OSPC}/[(]? { pop_return MEAN; } + MEDIAN{OSPC}/[(]? { pop_return MEDIAN; } + MIDRANGE{OSPC}/[(]? { pop_return MIDRANGE; } + MIN{OSPC}/[(]? { pop_return MIN; } + MOD{OSPC}/[(]? { pop_return MOD; } + NATIONAL-OF{OSPC}/[(]? { pop_return NATIONAL_OF; } + NUMVAL{OSPC}/[(]? { pop_return NUMVAL; } + NUMVAL-C{OSPC}/[(]? { pop_return NUMVAL_C; } + NUMVAL-F{OSPC}/[(]? { pop_return NUMVAL_F; } + ORD{OSPC}/[(]? { pop_return ORD; } + ORD-MAX{OSPC}/[(]? { pop_return ORD_MAX; } + ORD-MIN{OSPC}/[(]? { pop_return ORD_MIN; } + PI{OSPC}/[(]? { pop_return PI; } + PRESENT-VALUE{OSPC}/[(]? { pop_return PRESENT_VALUE; } + + RANDOM{OSPC}{PARENS} { pop_return RANDOM; } + RANDOM{OSPC}[(] { pop_return RANDOM_SEED; } + RANDOM { pop_return RANDOM; } + + RANGE{OSPC}/[(]? { pop_return RANGE; } + REM{OSPC}/[(]? { pop_return REM; } + REVERSE{OSPC}/[(]? { pop_return REVERSE; } + SECONDS-FROM-FORMATTED-TIME{OSPC}/[(]? { BEGIN(datetime_fmt); + return SECONDS_FROM_FORMATTED_TIME; } + SECONDS-PAST-MIDNIGHT{OSPC}/[(]? { pop_return SECONDS_PAST_MIDNIGHT; } + SIGN{OSPC}/[(]? { pop_return SIGN; } + SIN{OSPC}/[(]? { pop_return SIN; } + SQRT{OSPC}/[(]? { pop_return SQRT; } + STANDARD-DEVIATION{OSPC}/[(]? { pop_return STANDARD_DEVIATION; } + SUBSTITUTE{OSPC}/[(]? { pop_return SUBSTITUTE; } + SUM{OSPC}/[(]? { pop_return SUM; } + TAN{OSPC}/[(]? { pop_return TAN; } + TEST-DATE-YYYYMMDD{OSPC}/[(]? { pop_return TEST_DATE_YYYYMMDD; } + TEST-DAY-YYYYDDD{OSPC}/[(]? { pop_return TEST_DAY_YYYYDDD; } + TEST-FORMATTED-DATETIME{OSPC}/[(]? { BEGIN(datetime_fmt); return TEST_FORMATTED_DATETIME; } + TEST-NUMVAL{OSPC}/[(]? { pop_return TEST_NUMVAL; } + TEST-NUMVAL-C{OSPC}/[(]? { pop_return TEST_NUMVAL_C; } + TEST-NUMVAL-F{OSPC}/[(]? { pop_return TEST_NUMVAL_F; } + TRIM{OSPC}/[(]? { pop_return TRIM; } + ULENGTH{OSPC}/[(]? { pop_return ULENGTH; } + UPOS{OSPC}/[(]? { pop_return UPOS; } + UPPER-CASE{OSPC}/[(]? { pop_return UPPER_CASE; } + USUBSTR{OSPC}/[(]? { pop_return USUBSTR; } + USUPPLEMENTARY{OSPC}/[(]? { pop_return USUPPLEMENTARY; } + UUID4{OSPC}/[(]? { pop_return UUID4; } + UVALID{OSPC}/[(]? { pop_return UVALID; } + UWIDTH{OSPC}/[(]? { pop_return UWIDTH; } + VARIANCE{OSPC}/[(]? { pop_return VARIANCE; } + WHEN-COMPILED{OSPC}/[(]? { pop_return WHEN_COMPILED; } + YEAR-TO-YYYY{OSPC}/[(]? { pop_return YEAR_TO_YYYY; } + + {NAME}{OSPC}/[(] { /* If /{OSPC}, "dangerous trailing context" "*/ + auto& token(yylval.number); + auto name = null_trim(strdup(yytext)); + if( 0 != (token = symbol_function_token(name)) ) { + pop_return FUNCTION_UDF; + } + pop_return NO_CONDITION; + } + + {NAME} { auto token = typed_name(yytext); + pop_return (token == FUNCTION_UDF_0? token : NO_CONDITION); + } } /* diff --git a/gcc/cobol/symbols.cc b/gcc/cobol/symbols.cc index 4ea3918bc99304aaddf029be0bfa904bef7995d2..110c3f038255721950cb5d98adf463a29c3e9550 100644 --- a/gcc/cobol/symbols.cc +++ b/gcc/cobol/symbols.cc @@ -2854,11 +2854,11 @@ new_temporary_impl( enum cbl_field_type_t type ) struct cbl_field_t *f = new cbl_field_t; switch(type) { + case FldGroup: case FldAlphanumeric: *f = empty_alpha; break; case FldInvalid: - case FldGroup: case FldClass: case FldForward: case FldIndex: