Closed Michael-Janssen-dev closed 6 months ago
According to the definition of ALTER
, both of its arguments are "procedure" (paragraph) names, so the easy answer is that your code should lead to a compiler error at the second line of PROCEDURE DIVISION.
There is a version of GO TO
where a developer can use a field name instead, but there is no such version for ALTER.
PS: can I haz access to https://github.com/Michael-Janssen-dev/baby-cobol-compiler-v3?
Thank you. My understanding was that "ProcedureName" in the grammar meant that it was an identifier containing a procedure name, or an actual procedure name, because the same symbol is used in the grammar for GO TO.
Access has been granted 👍🏻
For the ALTER statement, if the new target paragraph (so after the TO) is an identifier, is the value of that identifier evaluated at ALTER, or when the altered paragraph is performed?
In the following example:
Would this display "B" or "C"?