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

Fix an issue in a user-defined parameterizing rule where the caller cannot access $$ in the rule #381

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

ydah
Copy link
Collaborator

@ydah ydah commented Feb 27, 2024

For example, if printf("pair odd even:% d\n," $1); was unable to access the pair side of $$with $1, fix this:

%rule pair(X, Y): X Y
  {
    $$ = $1 + $2;
    printf("(%d, %d)\n", $1, $2);
  }
  ;

stmt: pair(ODD, EVEN) <num> { printf("pair odd even: %d\n", $1); }

…annot access `$$` in the rule

For example, if `printf("pair odd even:% d\n," $1); `was unable to access the pair side of` $$`with` $1`, fix this:
```
%rule pair(X, Y): X Y
  {
    $$ = $1 + $2;
    printf("(%d, %d)\n", $1, $2);
  }
  ;

stmt: pair(ODD, EVEN) <num> { printf("pair odd even: %d\n", $1); }
```
@yui-knk yui-knk merged commit 85b2fe2 into ruby:master Feb 28, 2024
16 checks passed
@yui-knk
Copy link
Collaborator

yui-knk commented Feb 28, 2024

Thank you!

@ydah ydah deleted the fix-user-defined-action branch February 28, 2024 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants