Skip to content

Commit

Permalink
Use brace instead of paren for %parser-state
Browse files Browse the repository at this point in the history
  • Loading branch information
yui-knk committed Dec 21, 2023
1 parent bbaf64f commit 3340370
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 82 deletions.
156 changes: 78 additions & 78 deletions lib/lrama/parser.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ rule
{
@grammar.initial_action = Grammar::Code::InitialActionCode.new(type: :initial_action, token_code: val[3])
}
| "%parser-state" IDENTIFIER "(" identifier_list ")"
| "%parser-state" IDENTIFIER "{" identifier_list "}"
{
@grammar.add_parser_state(val[1], val[3])
}
Expand Down
6 changes: 3 additions & 3 deletions spec/fixtures/integration/parser_state.y
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ static int yyerror(YYLTYPE *loc, const char *str);

%expect 0

%parser-state in_rescue (before_rescue, after_rescue, after_else, after_ensure)
%parser-state in_def (in_def, not_in_def)
%parser-state in_class (in_class, not_in_class)
%parser-state in_rescue { before_rescue, after_rescue, after_else, after_ensure }
%parser-state in_def { in_def, not_in_def }
%parser-state in_class { in_class, not_in_class }

%token <i> keyword_begin keyword_end keyword_rescue keyword_else keyword_ensure keyword_class keyword_def
%token <i> NUM
Expand Down

0 comments on commit 3340370

Please sign in to comment.