-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add >>IMP INCLUDE directive #143
base: gcos4gnucobol-3.x
Are you sure you want to change the base?
Add >>IMP INCLUDE directive #143
Conversation
b2307d5
to
3936fe9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this first take - please copy the tests for --include
and adjust those for the directive. In gnbucobol.texi and NEWS add a remark in the --include
description, that the directive can be used as an alternative.
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.
|
c035033
to
7bb6097
Compare
2ad6625
to
7b94002
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still some requested changes - but we're on the finish line with this PR
d1abc18
to
67f4382
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"approved with minor changes"
f81defa
to
6a16582
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes to the testcases needed, overal fine
331e050
to
0df9e5b
Compare
0df9e5b
to
21b5d51
Compare
a387b82
to
6760a54
Compare
b47abf8
to
0bf5380
Compare
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall a good state, we should be able to add the missing pieces and be able to upstream that, soon
cobc/codegen.c
Outdated
if (last != NULL) { | ||
cobc_free (last->text); | ||
cobc_free (last); | ||
} | ||
last = l; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thought was to drop all the explicit cobc_free
calls and move this to "parser memory" using cobc_parse_malloc
instead for the allocation; then, potentially at ylex_clear_all or clear_local_codegen_vars unset the var...
Can you please check if this works?
Note: you currently allocate cb_include_file_list_directive
with cobc_parse_strdup
- so it is parser allocated already and will automatically be freed - you may only need to drop setting the "last" attribute (or create a separate structure) and the free calls here.
Codecov ReportAttention: Patch coverage is
❗ 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@GitMensch friendly ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nearly done, I'm positive that we reach the commit-state tomorrow :-)
Thanks for working on this again!
Should be good now. You were right, cobc aborted where compiling several COBOL files within the same command line. I added new checks:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, good that we ensured to not break something (I've found a lot ways to do so, which is often the reason I consider those checks .... nowadays - it is possible but hard to just deduce that when adding new code in that area for the first time).
Thanks again!
7d5f5ae
to
3efed41
Compare
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] |
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*/
.