gnucobol
gnucobol copied to clipboard
Add >>IMP INCLUDE directive
Closes #114 and completes FR176 on SourceForge.
A new directive >> IMP INCLUDE FILE_1 ... FILE_n is introduced, allowing to include multiple C headers. Only files with name finishing by .h are allowed.
I'm not sure about that but I marked the feature with /* GnuCOBOL 3.3 extension*/.
We don't need two lists, but we need to reset the list for each source file specified on the command line to the state from cobc command line.
Therefore either backup the whole list and restore it (similar to cb_source_format) or just use two lists and reset the second before each new source file. I'm ok with both ways but think the two-list approach is easier to handle.
@GitMensch Could you check this? It was almost finished and it was a rather minor change but I wasn't sure about the tests. Thank you!
I've rebased this PR and adjusted the "real" test for IMP INCLUDE. There are still open changes (see review notes), but I'm sure @engboris will have a look at those over the next days (or hours)?
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
Attention: Patch coverage is 73.07692% with 14 lines in your changes missing coverage. Please review.
Project coverage is 67.80%. Comparing base (
2c000f5) to head (1336ded). Report is 15 commits behind head on gcos4gnucobol-3.x.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## gcos4gnucobol-3.x #143 +/- ##
=====================================================
- Coverage 77.56% 67.80% -9.76%
=====================================================
Files 33 33
Lines 60230 60413 +183
Branches 15834 15888 +54
=====================================================
- Hits 46717 40966 -5751
- Misses 13513 13538 +25
- Partials 0 5909 +5909
| Flag | Coverage Δ | |
|---|---|---|
? |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@GitMensch friendly ping
Should be good now. You were right, cobc aborted where compiling several COBOL files within the same command line. I added new checks:
AT_SETUP([IMP INCLUDE directive multiple files])
AT_KEYWORDS([IMP INCLUDE])
AT_DATA([prog.cob], [
>>IMP INCLUDE "file1.h" file2.h <file3.h> "<file4.h>"
IDENTIFICATION DIVISION.
PROGRAM-ID. PROG.
PROCEDURE DIVISION.
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, [])
I did some mistakes while rebasing and fixing conflicts. I'm trying to fix it now.
@GitMensch Could you do a last quick check? I rebased and fixed conflicts but I may have introduced unwanted code although it is unlikely (all the tests are successful). I'm sorry for the inconvenience!
That's fine. [I've just checked the last "Compare", then the additional fix]
What is the status of this PR ? Is it ready to be merged ?
What is the status of this PR ? Is it ready to be merged ?
Yes, it should be ready (already marked with "Ready for SVN")
What is the status of this PR ? Is it ready to be merged ?
Yes, it should be ready (already marked with "Ready for SVN")
Ah, yeah, I overlooked the "Ready for SVN" tag. So I guess I can merge this to SVN right away, right @GitMensch ?
yes, just waits for the commit since two months
Merged in SVN @ 5448.