congo-cc / congo-parser-generator

The CongoCC Parser Generator, the Next Generation of JavaCC 21, which in turn was the next generation of JavaCC
https://discuss.congocc.org/
Other
36 stars 11 forks source link

Replace the use of postfix named nodes with LHS assignment of named nodes #77

Closed adMartem closed 10 months ago

adMartem commented 10 months ago

This uses the = and += LHS assignment feature to replace the postfix form of /.../and /[...]/ naming respectively. The generated code of referring to name nodes has also been changed to use the CURRENT_NODE as the host for behavior identical to the removed postfix form. Either this behavior and the previous behavior (which used THIS_PRODUCTION as the host for the named-node LHS case) work for all the existing tests, so this could be easily changed if THIS_PRODUCTION is deemed a more obvious and/or useful choice (as it would make property and named-node assignment consistent). Also, the use of THIS_PRODUCTION is now allowed to refer to the production node, if any, within which an expression using the term occurs in a manner similar to CURRENT_NODE, which of course continues to refer to the node being built, if any. There is also some cleanup/removal of test cases and temporary debugging checks as well as some non-essential uses of the postfix form of naming.