Skip to content

Commit

Permalink
Update Changelogs, minor fix and add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
engboris committed Dec 17, 2024
1 parent 781f586 commit 3efed41
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 25 deletions.
10 changes: 3 additions & 7 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ NEWS - user visible changes -*- outline -*-

* New GnuCOBOL features

** the leading space for all internal directives is removed in the lexer.
Source previously processed may need to be ajusted to be processed by
GnuCOBOL 3.3.

** cobc now checks for binary files and early exit parsing those;
the error output for format errors (for example invalid indicator column)
is now limitted to 5 per source file
** cobc now checks for binary and multi-byte encoded files and early exit
parsing those; the error output for format errors (for example invalid
indicator column) is now limitted to 5 per source file

** support the COLLATING SEQUENCE clause on indexed files
(currently only with the BDB backend)
Expand Down
9 changes: 6 additions & 3 deletions cobc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,12 @@

2024-04-25 Boris Eng <[email protected]>

* pplex.l, ppparse.y, scanner.l, cobc.h, codegen.c:
new >>IMP INCLUDE directive to include one or multiple header files in
the generated C code (same behavior as the --include compiler option)
FR #176: "Implementation of GC directive to include .h (c/c++) files"
* pplex.l, ppparse.y, cobc.h, codegen.c: new >>IMP INCLUDE directive to
include one or multiple header files in the generated C code (same behavior
as the --include but with one directive per file)
* scanner.l: the leading space for all internal directives is removed in the
lexer. Source previously preprocessed may need to be adjusted

2024-04-24 Fabrice Le Fessant <[email protected]>

Expand Down
1 change: 0 additions & 1 deletion cobc/cobc.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,6 @@ extern struct cb_text_list *cb_copy_list;
extern struct cb_text_list *cb_include_file_list; /* global */
extern struct cb_text_list *cb_include_file_list_directive; /* temporary */
extern struct cb_text_list *cb_include_list;
extern struct cb_text_list *cb_include_file_list_directive;
extern struct cb_text_list *cb_intrinsic_list;
extern struct cb_text_list *cb_extension_list;
extern struct cb_text_list *cb_static_call_list;
Expand Down
28 changes: 14 additions & 14 deletions cobc/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1832,24 +1832,24 @@ output_gnucobol_defines (const char *formatted_date)
current_compile_tm.tm_sec;
output_line ("#define COB_MODULE_TIME\t\t%d", i);

{
struct cb_text_list *l;
for (l = cb_include_file_list; l; l = l->next) {
if (l->text[0] == '<') {
output_line ("#include %s", l->text);
} else {
output_line ("#include \"%s\"", l->text);
}
struct cb_text_list *l;
for (l = cb_include_file_list; l; l = l->next) {
if (l->text[0] == '<') {
output_line ("#include %s", l->text);
} else {
output_line ("#include \"%s\"", l->text);
}
}

for (l = cb_include_file_list_directive; l; l = l->next) {
if (l->text[0] == '<') {
output_line ("#include %s", l->text);
} else {
output_line ("#include \"%s\"", l->text);
}
for (l = cb_include_file_list_directive; l; l = l->next) {
if (l->text[0] == '<') {
output_line ("#include %s", l->text);
} else {
output_line ("#include \"%s\"", l->text);
}
}

cb_include_file_list_directive = NULL;
}

/* CALL cache */
Expand Down
12 changes: 12 additions & 0 deletions tests/testsuite.src/syn_misc.at
Original file line number Diff line number Diff line change
Expand Up @@ -8464,10 +8464,22 @@ AT_DATA([prog.cob], [
GOBACK.
])

AT_DATA([prog2.cob], [
IDENTIFICATION DIVISION.
PROGRAM-ID. prog.
PROCEDURE DIVISION.
GOBACK.
])

AT_CHECK([$COMPILE --save-temps -E -o prog.i prog.cob], [0], [], [])
AT_CHECK([$COMPILE -C prog.cob prog2.cob], [0], [], [])
AT_CHECK([$GREP "#INCLUDE file1.h" prog.i], [0], ignore, [])
AT_CHECK([$GREP "#INCLUDE file2.h" prog.i], [0], ignore, [])
AT_CHECK([$GREP "#INCLUDE <file3.h>" prog.i], [0], ignore, [])
AT_CHECK([$GREP "#INCLUDE <file4.h>" prog.i], [0], ignore, [])
AT_CHECK([$GREP "#INCLUDE file1.h" prog.c], [1], ignore, [])
AT_CHECK([$GREP "#INCLUDE file2.h" prog.c], [1], ignore, [])
AT_CHECK([$GREP "#INCLUDE <file3.h>" prog.c], [1], ignore, [])
AT_CHECK([$GREP "#INCLUDE <file4.h>" prog.c], [1], ignore, [])

AT_CLEANUP

0 comments on commit 3efed41

Please sign in to comment.