Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Swift] only first rule parameter generated correctly #4477

Open
EXC-BAD-ACCESS opened this issue Nov 25, 2023 · 0 comments · May be fixed by #4480
Open

[Swift] only first rule parameter generated correctly #4477

EXC-BAD-ACCESS opened this issue Nov 25, 2023 · 0 comments · May be fixed by #4480

Comments

@EXC-BAD-ACCESS
Copy link

the following grammar generates invalid code for rule2 and rule3:

grammar T;

rule1[Int arg1]
    :   .
    ;

rule2[Int arg1, Int arg2]
    :   .
    ;

rule3[Int arg1, Int arg2, Int arg3]
    :   .
    ;

=>

open func rule2(_ arg1: Int!, _arg2: Int!) throws -> Rule2Context {
open func rule3(_ arg1: Int!, _arg2: Int!, _arg3: Int!) throws -> Rule3Context {

it should generate something like:

open func rule2(_ arg1: Int!, _ arg2: Int!) throws -> Rule2Context {
open func rule3(_ arg1: Int!, _ arg2: Int!, _ arg3: Int!) throws -> Rule3Context {

(space between "_" and "arg2" / "arg3"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant