Closed emilienlemaire closed 1 year ago
01 X CONSTANT AS BYTE-LENGTH OF BYTE-LENGTH.
@GitMensch Most documentations seem to make BYTE-LENGTH
sensitive in "constant entry", which I guess in principle spans from the level (01
above) to the terminating .
. In practice, restricting "constant entry" to start right after CONSTANT
makes sense, however I'm wondering whether the second BYTE-LENGTH
above is actually legitimate.
It is valid because the only thing that may be used there is a data-name, and therefore the data-names must be inspected. Note that GnuCOBOL has (with the default std) uses context-sensitivity quite often and "with reduced scope", which enables it to compile a lot of different dialects by limiting their "special" reserved words to be tokenized as reserved word where it actually may be used as this - otherwise it is recognized as user-defined word (mostly data-name or label-name)
@nberth : feel free to commit "upstream"
Now upstream - thanks again.
While working on configurations with @nberth, we discoverd that rules like
reserved: ALIAS*=CONTEXTUAL-WORD
in configuration files, the context sensitivity ofCONTEXTUAL-WORD
was never reported to the aliases. A small example with the following code:If we run the compiler with
reserved: XX*=BYTE-LENGTH
and replace allBYTE-LENGTH
in the code withXX
we get the following errors:when the file is expected to compile. After the changes introduced in this PR we can compile with contextual aliases.
This PR also fixes a small error in
config/ibm.conf