Widen the definable position of parameterizing rules - #420
Conversation
f358bde to
bdeb91f
Compare
|
I'm wondering which syntax is better for parameterizing rules definitions in Option 1. With
|
bdeb91f to
dbddd7b
Compare
|
@yui-knk I also thought Option2 was the way to go, but there was one annoying problem with Option2. The solution seems to be to either change the As a concrete example, the Option 2 correspondence allows us to write the following, so the part shown in the calet is conflicted. |
dbddd7b to
cd3f686
Compare
84059b4 to
65f739e
Compare
We came to this decision after discussion at RubyKaigi 2024.
Definitions are also possible in the following positions:
```
%rule defined_option(X): /* empty */
| X
;
%%
program : defined_option(number) <i>
| defined_list(number) <i>
;
%rule defined_list(X): /* empty */ /* <--- here */
| defined_list(X) number
;
```
65f739e to
b9c69de
Compare
We came to this decision after discussion at RubyKaigi 2024. Definitions are also possible in the following positions: