Skip to content

Commit f50ab57

Browse files
committed
Merge remote-tracking branch 'upstream/gnucobol-3.x' into gcos4gnucobol-3.x
2 parents f8a1a5c + f4ffd50 commit f50ab57

28 files changed

+714
-560
lines changed

.github/workflows/build_nightly.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,10 +500,7 @@ jobs:
500500
coverage:
501501
name: Coverage and Warnings
502502
needs: build
503-
# Since the latest Ubuntu image, lcov fails complaining about negative branch counts,
504-
# and using fprofile-update=atomic as suggested does not help, so use the previous image
505-
# runs-on: ubuntu-latest
506-
runs-on: ubuntu-22.04
503+
runs-on: ubuntu-latest
507504
timeout-minutes: 10
508505

509506
steps:

.github/workflows/ibm.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: IBM Power & Z
33
on:
44
pull_request:
55
branches: [ gcos4gnucobol-3.x ]
6+
push:
7+
branches: [ gcos4gnucobol-3.x ]
68
# manual run in actions tab - for all branches
79
workflow_dispatch:
810

cobc/ChangeLog

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11

2+
2025-07-30 Simon Sobisch <simonsobisch@gnu.org>
3+
4+
* scanner.l, parser.y, reserved.c: use yyless to push part of scanned
5+
tokens back, used in case of multi-word scanning, if one or more scanned
6+
words are reserved: PICTURE SYMBOL, FROM CRT, SCREEN CONTROL,
7+
EVENT STATUS
8+
* parser.y, scanner.l, reserved.c, cobc.h: READY, RESET and TRACE as
9+
reserved words (TRACE is C/S for std default), fixing bug #1130 while
10+
increasing portability (for dialects not reserving it), dropping
11+
special handling within the scanner and extra tokens in the parser
12+
* ppparse.y, pplex.l: add (simple) handling for SET TRACE/NOTRACE
13+
214
2025-07-28 David Declerck <david.declerck@ocamlpro.com>
315

416
* codegen.c (output_module_init_function): replace "module" by
@@ -1004,7 +1016,7 @@
10041016
2023-02-09 Simon Sobisch <simonsobisch@gnu.org>
10051017

10061018
* typeck.c (validate_alphabet): slightly rewritten to fix compiler warnings
1007-
* config.c, pparse.y (ppp_replace_list_add), reserved.c (is_invalid_word),
1019+
* config.c, ppparse.y (ppp_replace_list_add), reserved.c (is_invalid_word),
10081020
tree.c, tree.h, typeck.c: minor adjustments to fix compiler warnings
10091021
* field.c (validate_multi_value, validate_elem_value),
10101022
parser.y (setup_external_definition): fixed analyzer warnings by switching
@@ -1709,7 +1721,7 @@
17091721
* pplex.l: match and ignore editor folding $REGION statement
17101722
* pplex.l: output actual directive for @OPTIONS and PROCESS
17111723
* pplex.l: *CONTROL from col7+
1712-
* pparse.y: don't warn on *CONTROL as this adjust listing only
1724+
* ppparse.y: don't warn on *CONTROL as this adjust listing only
17131725
and does not apply directly (possibly real handling later)
17141726

17151727
2022-08-19 Simon Sobisch <simonsobisch@gnu.org>
@@ -2714,7 +2726,7 @@
27142726
FR #390 ref-mod with zero-length
27152727
* config.def, typeck.c (cb_build_identifier): added cb_ref_mod_zero_length
27162728
to allow reference-modification at compile-time with a length of zero
2717-
* pparse.y, pplex.l, scanner.l, cobc.c: added >> REF-MOD-ZERO-LENGTH and
2729+
* ppparse.y, pplex.l, scanner.l, cobc.c: added >> REF-MOD-ZERO-LENGTH and
27182730
adjusted SSRANGE, now also supporting SSRANGE"1" and SSRANGE"3"
27192731

27202732
2020-11-04 Simon Sobisch <simonsobisch@gnu.org>
@@ -3858,7 +3870,7 @@
38583870

38593871
2018-11-22 Simon Sobisch <simonsobisch@gnu.org>
38603872

3861-
* pplex.l, pparse.y: FR #344 Support copybook and library names
3873+
* pplex.l, ppparse.y: FR #344 Support copybook and library names
38623874
as text-names (not literals) with periods, always upper-cased
38633875
if not requested otherwise by FOLD-CALL=LOWER
38643876

@@ -6913,7 +6925,7 @@
69136925
2016-04-24 Simon Sobisch <simonsobisch@gnu.org>
69146926

69156927
* parser.y: implement STOP RUN integer/identifier (RM/COBOL extension)
6916-
* parser.y, pparse.y: remove printf non literal spec warning.
6928+
* parser.y, ppparse.y: remove printf non literal spec warning.
69176929

69186930
2016-04-24 Edward Hart <edward.dan.hart@gmail.com>
69196931

@@ -9776,7 +9788,7 @@
97769788

97779789
2003-05-26 Keisuke Nishida <knishida@wind.sannet.ne.jp>
97789790

9779-
* pplex.l (ppcopy), pparse.y, cobc.c, cobc.h: split ppcopy from ppopen
9791+
* pplex.l (ppcopy), ppparse.y, cobc.c, cobc.h: split ppcopy from ppopen
97809792

97819793
2003-05-21 Keisuke Nishida <knishida@netlab.jp>
97829794

@@ -9818,13 +9830,13 @@
98189830

98199831
integrate cobcpp into cobc
98209832
* pplex.l: renamed and adjusted from cobpp/scanner.l
9821-
* pparse.y: renamed and adjusted from cobpp/parser.y
9833+
* ppparse.y: renamed and adjusted from cobpp/parser.y
98229834
* cobc.h: definitions from scanner.h
98239835
* Makefile.am, cobc.c: adjusted
98249836

98259837
2003-04-02 Keisuke Nishida <knishida@netlab.jp>
98269838

9827-
* pparse.y <- cobpp/parser.y, pplex.l <- cobpp/scanner.l: support for
9839+
* ppparse.y <- cobpp/parser.y, pplex.l <- cobpp/scanner.l: support for
98289840
SOURCE FORMAT compiler directive
98299841

98309842
2003-03-26 Keisuke Nishida <knishida@netlab.jp>
@@ -9950,7 +9962,7 @@
99509962
* cobc.c (probe_source_format): Removed.
99519963
(preprocess): Don't set source format.
99529964
(process_command_line): Set cobpp flags here.
9953-
* pparse.y <- cobpp/parser.y (yywarn): New function.
9965+
* ppparse.y <- cobpp/parser.y (yywarn): New function.
99549966
* cobpp.h (COBPP_FORMAT_UNKNOWN): New macro.
99559967
* cobpp.h, cobpp.c (cobpp_source_format_inferred): New variable.
99569968
* cobpp.c (cobpp_source_format): Default to COBPP_FORMAT_UNKNOWN.
@@ -10154,7 +10166,7 @@
1015410166

1015510167
2002-06-07 Keisuke Nishida <knishida@netlab.jp>
1015610168

10157-
* pparse.y <- cobpp/parser.y (copy_statement, copy_in, copy_replacing):
10169+
* ppparse.y <- cobpp/parser.y (copy_statement, copy_in, copy_replacing):
1015810170
Support "COPY ... IN/OF ..." syntax.
1015910171
* pplex.l <- cobpp/scanner.l, scanner.h (include_copybook): Take a library name.
1016010172

cobc/cobc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ enum cb_current_date {
176176
#define CB_CS_DEFAULT CB_CS_DAY
177177
#define CB_CS_VALIDATE_STATUS CB_CS_DAY
178178
#define CB_CS_USAGE CB_CS_DAY
179+
#define CB_READY_RESET_TRACE CB_CS_DAY
179180

180181
/* Support for cobc from stdin */
181182
#define COB_DASH "-"

cobc/parser.y

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3146,7 +3146,7 @@ set_record_size (cb_tree min, cb_tree max)
31463146
%token READ
31473147
%token READERS
31483148
%token READ_ONLY "READ-ONLY"
3149-
%token READY_TRACE "READY TRACE"
3149+
%token READY
31503150
%token RECEIVE
31513151
%token RECEIVED /* remark: not used here */
31523152
%token RECORD
@@ -3183,7 +3183,6 @@ set_record_size (cb_tree min, cb_tree max)
31833183
%token RERUN
31843184
%token RESERVE
31853185
%token RESET
3186-
%token RESET_TRACE "RESET TRACE"
31873186
%token RESET_GRID "RESET-GRID"
31883187
%token RESET_LIST "RESET-LIST"
31893188
%token RESET_TABS "RESET-TABS"
@@ -3298,6 +3297,7 @@ set_record_size (cb_tree min, cb_tree max)
32983297
%token SUM
32993298
%token SUPPRESS
33003299
%token SUPPRESS_XML "SUPPRESS"
3300+
%token SYMBOL
33013301
%token SYMBOLIC
33023302
%token SYNCHRONIZED
33033303
%token SYSTEM_DEFAULT "SYSTEM-DEFAULT"
@@ -3351,6 +3351,7 @@ set_record_size (cb_tree min, cb_tree max)
33513351
%token TOP
33523352
%token TOWARD_GREATER "TOWARD-GREATER"
33533353
%token TOWARD_LESSER "TOWARD-LESSER"
3354+
%token TRACE
33543355
%token TRACK
33553356
%token TRACKS
33563357
%token TRACK_AREA "TRACK-AREA"
@@ -3497,10 +3498,10 @@ set_record_size (cb_tree min, cb_tree max)
34973498
%nonassoc PURGE
34983499
%nonassoc RAISE
34993500
%nonassoc READ
3500-
%nonassoc READY_TRACE
3501+
%nonassoc READY
35013502
%nonassoc RECEIVE
35023503
%nonassoc RELEASE
3503-
%nonassoc RESET_TRACE
3504+
%nonassoc RESET
35043505
%nonassoc RETURN
35053506
%nonassoc REWRITE
35063507
%nonassoc ROLLBACK
@@ -15966,7 +15967,11 @@ _end_read:
1596615967
/* READY TRACE statement */
1596715968

1596815969
ready_statement:
15969-
READY_TRACE
15970+
READY
15971+
{
15972+
cobc_cs_check = CB_READY_RESET_TRACE;
15973+
}
15974+
TRACE
1597015975
{
1597115976
begin_statement (STMT_READY_TRACE, 0);
1597215977
cb_emit_ready_trace ();
@@ -16051,7 +16056,11 @@ release_body:
1605116056
/* RESET TRACE statement */
1605216057

1605316058
reset_statement:
16054-
RESET_TRACE
16059+
RESET
16060+
{
16061+
cobc_cs_check = CB_READY_RESET_TRACE;
16062+
}
16063+
TRACE
1605516064
{
1605616065
begin_statement (STMT_RESET_TRACE, 0);
1605716066
cb_emit_reset_trace ();

cobc/pplex.l

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (C) 2001-2012, 2014-2024 Free Software Foundation, Inc.
2+
Copyright (C) 2001-2012, 2014-2025 Free Software Foundation, Inc.
33
Written by Keisuke Nishida, Roger While, Simon Sobisch, Dave Pitts
44
55
This file is part of GnuCOBOL.
@@ -914,6 +914,10 @@ COBOL_WORDS_DIRECTIVE_STATE>{
914914
"NO-SPZERO" {
915915
return NOSPZERO;
916916
}
917+
"NOTRACE" |
918+
"NO-TRACE" {
919+
return NOTRACE;
920+
}
917921
"ODOSLIDE" {
918922
return ODOSLIDE;
919923
}
@@ -929,6 +933,9 @@ COBOL_WORDS_DIRECTIVE_STATE>{
929933
"SPZERO" {
930934
return SPZERO;
931935
}
936+
"TRACE" {
937+
return TRACE;
938+
}
932939
"SOURCEFORMAT" |
933940
"SOURCE-FORMAT" {
934941
return SOURCEFORMAT;

cobc/ppparse.y

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (C) 2001-2012, 2015-2023 Free Software Foundation, Inc.
2+
Copyright (C) 2001-2012, 2015-2023, 2025 Free Software Foundation, Inc.
33
Written by Keisuke Nishida, Roger While, Simon Sobisch, Edward Hart
44
55
This file is part of GnuCOBOL.
@@ -707,12 +707,14 @@ ppparse_clear_vars (const struct cb_define_struct *p)
707707
%token NOODOSLIDE
708708
%token NOSPZERO
709709
%token NOSSRANGE
710+
%token NOTRACE
710711
/* OVERRIDE token defined above. */
711712
%token ODOSLIDE
712713
%token REMOVE
713714
%token SOURCEFORMAT
714715
%token SPZERO
715716
%token SSRANGE
717+
%token TRACE
716718

717719
%token IF_DIRECTIVE
718720
%token ELSE_DIRECTIVE
@@ -896,6 +898,8 @@ set_directive:
896898
| set_directive set_choice
897899
;
898900

901+
/* FIXME: *all* of the choices below should be #PASSED to the scanner
902+
and handled there */
899903
set_choice:
900904
CONSTANT VARIABLE_NAME LITERAL
901905
{
@@ -1047,6 +1051,11 @@ set_choice:
10471051

10481052
append_to_turn_list (txt, 0, 0);
10491053
}
1054+
| NOTRACE
1055+
{
1056+
cb_flag_traceall = 0;
1057+
cb_flag_trace = 0;
1058+
}
10501059
| ODOSLIDE
10511060
{
10521061
fprintf (ppout, "#ODOSLIDE 1\n");
@@ -1124,6 +1133,10 @@ set_choice:
11241133
ppp_error_invalid_option ("SSRANGE", p);
11251134
}
11261135
}
1136+
| TRACE
1137+
{
1138+
cb_flag_trace = 1; /* no traceall with Visual COBOL, leave untouched */
1139+
}
11271140
;
11281141

11291142
alnum_list:

cobc/reserved.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (C) 2001-2012, 2014-2024 Free Software Foundation, Inc.
2+
Copyright (C) 2001-2012, 2014-2025 Free Software Foundation, Inc.
33
Written by Keisuke Nishida, Roger While, Simon Sobisch, Edward Hart
44
55
This file is part of GnuCOBOL.
@@ -2329,6 +2329,9 @@ static struct cobc_reserved default_reserved_words[] = {
23292329
{ "READ-ONLY", 0, 1, READ_ONLY, /* ACU extension */
23302330
0, CB_CS_GRAPHICAL_CONTROL | CB_CS_INQUIRE_MODIFY
23312331
},
2332+
{ "READY", 1, 0, READY, /* OSVS */
2333+
CB_READY_RESET_TRACE, 0
2334+
},
23322335
{ "READERS", 0, 1, READERS, /* ACU extension */
23332336
0, CB_CS_OPEN
23342337
},
@@ -2438,8 +2441,8 @@ static struct cobc_reserved default_reserved_words[] = {
24382441
{ "RESERVE", 0, 0, RESERVE, /* 2002 */
24392442
0, 0
24402443
},
2441-
{ "RESET", 0, 0, RESET, /* 2002 */
2442-
0, 0
2444+
{ "RESET", 1, 0, RESET, /* 2002 */
2445+
CB_READY_RESET_TRACE, 0
24432446
},
24442447
{ "RESET-GRID", 0, 1, RESET_GRID, /* ACU extension */
24452448
0, CB_CS_GRAPHICAL_CONTROL | CB_CS_INQUIRE_MODIFY
@@ -2791,9 +2794,11 @@ static struct cobc_reserved default_reserved_words[] = {
27912794
{ "SUPPRESS", 0, 0, SUPPRESS, /* 2002 */
27922795
0, 0
27932796
},
2794-
{ "SYMBOL", 0, 1, -1, /* 2002 (C/S) */
2797+
{ "SYMBOL", 0, 1, SYMBOL, /* 2002 (C/S) */
27952798
0, 0
2796-
/* FIXME: 2014 Context-sensitive to CURRENCY clause */
2799+
/* FIXME: 2014 Context-sensitive to CURRENCY clause; note: we currently
2800+
work around that by scanning it only together with PICTURE as reserved
2801+
word, ignoring any other context there */
27972802
},
27982803
{ "SYMBOLIC", 0, 0, SYMBOLIC, /* 2002 */
27992804
0, 0
@@ -2906,6 +2911,9 @@ static struct cobc_reserved default_reserved_words[] = {
29062911
{ "TOWARD-LESSER", 0, 1, TOWARD_LESSER, /* 2014 (C/S) */
29072912
0, CB_CS_ROUNDED
29082913
},
2914+
{ "TRACE", 0, 1, TRACE, /* OSVS */
2915+
0, CB_READY_RESET_TRACE
2916+
},
29092917
{ "TRACK", 0, 1, TRACK, /* OS/VS extension */
29102918
0, CB_CS_SELECT | CB_CS_I_O_CONTROL
29112919
},

0 commit comments

Comments
 (0)