Closed edgardozoppi closed 2 years ago
Now almost all existing uses of Expression have became NonEmptyExpression, except the usage for function arguments. This makes me consider doing the opposite thing of creating a new non-terminal PossibleEmptyExpression that is only used for function arguments and leave as Expression all the other usages that require a non-empty expression. I believe it feels more natural. What do you think?
Now almost all existing uses of Expression have became NonEmptyExpression, except the usage for function arguments. This makes me consider doing the opposite thing of creating a new non-terminal PossibleEmptyExpression that is only used for function arguments and leave as Expression all the other usages that require a non-empty expression. I believe it feels more natural. What do you think?
Although I agree with the sentiment, in actual fact Pop-11 allows empty-expressions in far too many places. (Later on in this project I intend to produce a modified version of the Poplog compiler that is a bit stricter about empty expressions. But for now we need to stick to what is implemented.)
This PR goes quite a bit further than my user story - and that's where it is not quite right. I have made explicit notes everywhere in the EBNF, which I find much easier to read.
And finally I do appreciate that this loose treatment of empty-expressions will seem like catastrophically bad syntax design & I am highly amused imagining your reaction at some of my examples - all of which are drawn from a live Pop-11 interpreter! In my personal opinion it is poor syntax design but in practice it rarely causes problems. Exactly why it causes so few problems I haven't ever really come to a good conclusion over. I suspect that it is as simple as omitting entire expressions is a rare blunder.
Resolves #7 issue.