Support more compiler directives#257
Conversation
|
Would this handle #153 ? |
No, the |
|
We would like to be able to parse the whole https://github.com/OCamlPro/gnucobol-contrib/tree/1618cb70d3855fd56a17bb2522c421e38993fc6d/samples/worldcities folder, (with the fixes from OCamlPro/gnucobol-contrib#1), and this is used in some files |
I see in there it's not used in floating position… so maybe Boris's suggestion could work (as a temporary measure). |
I think only GnuCOBOL supports that and the features is removed in COBOL 2014, so handling this specific one is likely not important. |
0a6c7c9 to
460b4e3
Compare
emilienlemaire
left a comment
There was a problem hiding this comment.
Seems all good to me, but one question concerning a test failure
emilienlemaire
left a comment
There was a problem hiding this comment.
All good for me 👌
I'd love a PR for GnuCOBOL on that as well :-) Concerning this PR: Do you want to do a follow-up for the MF conditional compilation? 78 my-define VALUE 5.
$IF my-define
DISPLAY 'something'
$END |
The |
Also avoid emitting empty semantic tokens
27537e8 to
c239bb0
Compare
GitMensch
left a comment
There was a problem hiding this comment.
There are some issues on the MF side (see comments), but I'm mostly concerned about ISO.
I don't know if there's a preparser applied or if the compdir_grammar.mly keywords are taken "verbatim".
ISO says:
A compiler directive is composed of the compiler directive indicator
>>, optionally followed by the COBOL character space, followed by compiler-instruction. The compiler directive indicator shall be treated as though it were followed by a space if no space is specified after the indicator.
Also note that "the COBOL character space" can consist of multiple character spaces.
I do wonder: does
>> IF something DEFINED
PERFORM something
>> ELSE
PERFORM other-stuff
>>END-IFworks.
…ple spaces As per the ISO/IEC 1989:2014, page 92: > Anywhere a space is used as a separator or as part of a separator, > more than one space may be used.
Those
For that, I originally followed GnuCOBOL. The version I used did not allow more than one character, so |
Oh, please check that then. Concerning this PR it looks good to me now. |
Adds support for
>>DEFINEand simple (cascading) conditional compilation directives.>>SETdirectives are parsed but not interpreted yet.>>EVALUATE/>>WHENshall be added in a subsequent PR.