gnucobol icon indicating copy to clipboard operation
gnucobol copied to clipboard

Try moving Area A checks and handling of missing periods from the parser into the scanner

Open nberth opened this issue 2 years ago • 1 comments

For sure the current approach is incomplete and does not cover many cases as you noticed (I think I mentioned this limitation a while ago, but maybe I was not explaining this clearly enough…).

I think working that around properly and in full generality is very tricky with the current pull parser. One approach may be to switch to a push parser whose state may be checked in the scanner when issuing tokens; I tried this at some point, but hit some other problems as this messes up parts of the state that is shared between the scanner and the parser. Going the ad hoc route and adding more manual checks in some places could work, but only in the short term.

Note that moving area A detection to the scanner may require moving the detection of missing periods there as well…

Originally posted by @nberth in https://github.com/OCamlPro/gnucobol/issues/35#issuecomment-1447967530

nberth avatar Feb 28 '23 15:02 nberth

For GC 3.2 the current approach will be kept, so I'm adding a bunch of manual checks that I've found missing. Testing other approaches that may be shipped later sounds like a good thing to do (but seems like a bigger task).

GitMensch avatar Jun 09 '23 09:06 GitMensch