Closed maxonfjvipon closed 10 months ago
@Graur please set Urgent
milestone to it
@maxonfjvipon I didn't understand the problem described here. What exactly is wrong? You are talking about Program.g4
file?
@yegor256 yes, about Program.g4
where EBNF
is described (if I'm not mistaken in terms). Current amount and structure of key syntax blocks (like head
, application
, htail
) don't allow us to resolve all of above syntax bugs by small changes and fixes (I tried) because there's a mess in there. I'm sure that current grammar allows us to write much invalid code, we just haven't come across such examples yet.
I strongly believe that we should make a kind of breakthrough change - rewrite the grammar, make it fuller, wider and from the very beginning to put a solution of all bugs above there
@maxonfjvipon sounds like a good intent, but I'm not sure it's possible to just "make it better" :) You are more than welcome to try.
@yegor256 image this code:
[name] > cat
name > @
* cat > cats
stdout > @
cats.at 0
"Lisa"
With current grammar this code is valid but it does not work.
tuple.at
firstly) -> set name to "Lisa"(application of cat
secondly)"tuple.at
with two arguments - 0 and "Lisa""So there's a conflict of vertical and horizontal applications. I believe this code should be invalid on the level of grammar, means we should not allow to mix horizontal and vertical applications at all, even with braces, so this should be not valid too:
(cats.at 0)
"Lisa"
What do you think?
@maxonfjvipon this issue does make sense (the one about vertical-vs-horizontal notation), but it should be in a new ticket
Current syntax EBNF is quite poor and "weak". There are not enough structure blocks to resolve almost all our syntax errors: #415, #1468, #1469, #1841, #2291, #2320, #2321. Need to rewrite it and make stricter