OCamlPro / gnucobol

A clone of the sourceforge GnuCOBOL compiler from COBOL to C.
https://get-superbol.com
GNU Lesser General Public License v3.0
20 stars 24 forks source link

[GCOS] Allow the WITH CONVERSION clause right after DISPLAY #34

Closed ddeclerck closed 2 years ago

GitMensch commented 2 years ago

I suggest to implement this completely by creating an intermediate field for this according to the GCOS rules, then do an implicit move and then display the temporary field. ... and obviously "pretty-display" should be set to "false" in gcos-strict.cfg (haven't checked its current value).

ddeclerck commented 2 years ago

I'm not sure how quickly I could implement this correctly (haven't dug too far in GnuCobol's source code yet), considering our time/budget constraints. For now, our customer just needs this to parse, even if the output is not exactly as expected.

GitMensch commented 2 years ago

Then please use CB_PENDING for this now.

GitMensch commented 2 years ago

To finish this PR please add the missing syntax check to ensure that WITH CONVERSION can actually be parsed (I see no reason that it doesn't, but the added test ensures the test coverage does not go down and that the syntax will be supported in the future, too.

... and you may find the test not working in which case you'd have to adjust cobc/reserved.c and add CB_CS_DISPLAY to the context check.

GitMensch commented 2 years ago

The testcase is fine, "ugly" looked

warning: WITH CONVERSION is not implemented

the new one is better:

warning: DISPLAY WITH CONVERSION is not implemented

ddeclerck commented 2 years ago

Alright, thanks.

nberth commented 2 years ago

(Marked as WIP as awaiting a rebase w.r.t gcos4gnucobol-3.x)

GitMensch commented 2 years ago

Feel free to commit this as-is to svn at any time.

nberth commented 2 years ago

Now upstream.