Ruby: 3.4 → 4.0

+31 / −11 / 35 Changed

JSON / Grammar changes

Tokens

+

− tRPAREN

args_tail_basic_arg_value + Added

4.0

+ args_tail_basic_arg_value ::= f_kwarg_arg_value ',' f_kwrest opt_f_block_arg
+     | f_kwarg_arg_value opt_f_block_arg
+     | f_any_kwrest opt_f_block_arg
+     | f_block_arg

args_tail_basic_primary_value + Added

4.0

+ args_tail_basic_primary_value ::= f_kwarg_primary_value ',' f_kwrest opt_f_block_arg
+     | f_kwarg_primary_value opt_f_block_arg
+     | f_any_kwrest opt_f_block_arg
+     | f_block_arg

asgn_arg_rhs + Added

4.0

+ asgn_arg_rhs ::= lhs '=' lex_ctxt arg_rhs

asgn_command_rhs + Added

4.0

+ asgn_command_rhs ::= lhs '=' lex_ctxt command_rhs

asgn_mrhs + Added

4.0

+ asgn_mrhs ::= lhs '=' lex_ctxt mrhs

command_call_value + Added

4.0

+ command_call_value ::= value_expr_command_call

compstmt_stmts + Added

4.0

+ compstmt_stmts ::= stmts option_terms

compstmt_top_stmts + Added

4.0

+ compstmt_top_stmts ::= top_stmts option_terms

def_endless_method_endless_arg + Added

4.0

+ def_endless_method_endless_arg ::= defn_head f_opt_paren_args '=' endless_arg
+     | defs_head f_opt_paren_args '=' endless_arg

def_endless_method_endless_command + Added

4.0

+ def_endless_method_endless_command ::= defn_head f_opt_paren_args '=' endless_command
+     | defs_head f_opt_paren_args '=' endless_command

f_kw_arg_value + Added

4.0

+ f_kw_arg_value ::= f_label arg_value
+     | f_label

f_kw_primary_value + Added

4.0

+ f_kw_primary_value ::= f_label primary_value
+     | f_label

f_kwarg_arg_value + Added

4.0

+ f_kwarg_arg_value ::= f_kw_arg_value
+     | f_kwarg_arg_value ',' f_kw_arg_value

f_kwarg_primary_value + Added

4.0

+ f_kwarg_primary_value ::= f_kw_primary_value
+     | f_kwarg_primary_value ',' f_kw_primary_value

f_opt_arg_arg_value + Added

4.0

+ f_opt_arg_arg_value ::= f_opt_arg_value
+     | f_opt_arg_arg_value ',' f_opt_arg_value

f_opt_arg_primary_value + Added

4.0

+ f_opt_arg_primary_value ::= f_opt_primary_value
+     | f_opt_arg_primary_value ',' f_opt_primary_value

mlhs_items_f_marg + Added

4.0

+ mlhs_items_f_marg ::= f_marg
+     | mlhs_items_f_marg ',' f_marg

mlhs_items_mlhs_item + Added

4.0

+ mlhs_items_mlhs_item ::= mlhs_item
+     | mlhs_items_mlhs_item ',' mlhs_item

op_asgn_arg_rhs + Added

4.0

var_lhs tOP_ASGNtOP_ASGN lex_ctxt arg_rhs primary_value '[''[' opt_call_args rbracket tOP_ASGNtOP_ASGN lex_ctxt arg_rhs primary_value call_op tIDENTIFIERtIDENTIFIER tOP_ASGNtOP_ASGN lex_ctxt arg_rhs primary_value call_op tCONSTANTtCONSTANT tOP_ASGNtOP_ASGN lex_ctxt arg_rhs primary_value tCOLON2tCOLON2 tIDENTIFIERtIDENTIFIER tOP_ASGNtOP_ASGN lex_ctxt arg_rhs primary_value tCOLON2tCOLON2 tCONSTANTtCONSTANT tOP_ASGNtOP_ASGN lex_ctxt arg_rhs tCOLON3tCOLON3 tCONSTANTtCONSTANT tOP_ASGNtOP_ASGN lex_ctxt arg_rhs backref tOP_ASGNtOP_ASGN lex_ctxt arg_rhs
+ op_asgn_arg_rhs ::= var_lhs tOP_ASGN lex_ctxt arg_rhs
+     | primary_value '[' opt_call_args rbracket tOP_ASGN lex_ctxt arg_rhs
+     | primary_value call_op tIDENTIFIER tOP_ASGN lex_ctxt arg_rhs
+     | primary_value call_op tCONSTANT tOP_ASGN lex_ctxt arg_rhs
+     | primary_value tCOLON2 tIDENTIFIER tOP_ASGN lex_ctxt arg_rhs
+     | primary_value tCOLON2 tCONSTANT tOP_ASGN lex_ctxt arg_rhs
+     | tCOLON3 tCONSTANT tOP_ASGN lex_ctxt arg_rhs
+     | backref tOP_ASGN lex_ctxt arg_rhs

op_asgn_command_rhs + Added

4.0

var_lhs tOP_ASGNtOP_ASGN lex_ctxt command_rhs primary_value '[''[' opt_call_args rbracket tOP_ASGNtOP_ASGN lex_ctxt command_rhs primary_value call_op tIDENTIFIERtIDENTIFIER tOP_ASGNtOP_ASGN lex_ctxt command_rhs primary_value call_op tCONSTANTtCONSTANT tOP_ASGNtOP_ASGN lex_ctxt command_rhs primary_value tCOLON2tCOLON2 tIDENTIFIERtIDENTIFIER tOP_ASGNtOP_ASGN lex_ctxt command_rhs primary_value tCOLON2tCOLON2 tCONSTANTtCONSTANT tOP_ASGNtOP_ASGN lex_ctxt command_rhs tCOLON3tCOLON3 tCONSTANTtCONSTANT tOP_ASGNtOP_ASGN lex_ctxt command_rhs backref tOP_ASGNtOP_ASGN lex_ctxt command_rhs
+ op_asgn_command_rhs ::= var_lhs tOP_ASGN lex_ctxt command_rhs
+     | primary_value '[' opt_call_args rbracket tOP_ASGN lex_ctxt command_rhs
+     | primary_value call_op tIDENTIFIER tOP_ASGN lex_ctxt command_rhs
+     | primary_value call_op tCONSTANT tOP_ASGN lex_ctxt command_rhs
+     | primary_value tCOLON2 tIDENTIFIER tOP_ASGN lex_ctxt command_rhs
+     | primary_value tCOLON2 tCONSTANT tOP_ASGN lex_ctxt command_rhs
+     | tCOLON3 tCONSTANT tOP_ASGN lex_ctxt command_rhs
+     | backref tOP_ASGN lex_ctxt command_rhs

opt_block_param_def + Added

4.0

+ opt_block_param_def ::= none
+     | block_param_def

range_expr_arg + Added

4.0

arg tDOT2tDOT2 arg arg tDOT3tDOT3 arg arg tDOT2tDOT2 arg tDOT3tDOT3 tBDOT2tBDOT2 arg tBDOT3tBDOT3 arg
+ range_expr_arg ::= arg tDOT2 arg
+     | arg tDOT3 arg
+     | arg tDOT2
+     | arg tDOT3
+     | tBDOT2 arg
+     | tBDOT3 arg

range_expr_p_primitive + Added

4.0

p_primitive tDOT2tDOT2 p_primitive p_primitive tDOT3tDOT3 p_primitive p_primitive tDOT2tDOT2 p_primitive tDOT3tDOT3 tBDOT2tBDOT2 p_primitive tBDOT3tBDOT3 p_primitive
+ range_expr_p_primitive ::= p_primitive tDOT2 p_primitive
+     | p_primitive tDOT3 p_primitive
+     | p_primitive tDOT2
+     | p_primitive tDOT3
+     | tBDOT2 p_primitive
+     | tBDOT3 p_primitive

singleton_expr + Added

4.0

+ singleton_expr ::= var_ref
+     | '(' $@40 expr rparen

ternary + Added

4.0

+ ternary ::= arg '?' arg option_'\n' ':' arg

value_expr_arg + Added

4.0

+ value_expr_arg ::= arg

value_expr_command + Added

4.0

+ value_expr_command ::= command

value_expr_command_call + Added

4.0

+ value_expr_command_call ::= command_call

value_expr_expr + Added

4.0

+ value_expr_expr ::= expr

value_expr_primary + Added

4.0

+ value_expr_primary ::= primary

value_expr_singleton_expr + Added

4.0

+ value_expr_singleton_expr ::= singleton_expr

compstmt − Removed

3.4

− compstmt ::= stmts option_terms

f_block_kw − Removed

3.4

− f_block_kw ::= f_label primary_value
−     | f_label

f_kw − Removed

3.4

− f_kw ::= f_label arg_value
−     | f_label

f_kwarg_f_block_kw − Removed

3.4

− f_kwarg_f_block_kw ::= f_block_kw
−     | f_kwarg_f_block_kw ',' f_block_kw

f_kwarg_f_kw − Removed

3.4

− f_kwarg_f_kw ::= f_kw
−     | f_kwarg_f_kw ',' f_kw

f_marg_list − Removed

3.4

− f_marg_list ::= f_marg
−     | f_marg_list ',' f_marg

f_optarg_arg_value − Removed

3.4

− f_optarg_arg_value ::= f_opt_arg_value
−     | f_optarg_arg_value ',' f_opt_arg_value

f_optarg_primary_value − Removed

3.4

− f_optarg_primary_value ::= f_opt_primary_value
−     | f_optarg_primary_value ',' f_opt_primary_value

mlhs_post − Removed

3.4

− mlhs_post ::= mlhs_item
−     | mlhs_post ',' mlhs_item

operation − Removed

3.4

tIDENTIFIERtIDENTIFIER tCONSTANTtCONSTANT tFIDtFID
− operation ::= tIDENTIFIER
−     | tCONSTANT
−     | tFID

top_compstmt − Removed

3.4

− top_compstmt ::= top_stmts option_terms

arg ± Changed

3.4

lhs '=''=' lex_ctxt arg_rhs var_lhs tOP_ASGNtOP_ASGN lex_ctxt arg_rhs primary_value '[''[' opt_call_args rbracket tOP_ASGNtOP_ASGN lex_ctxt arg_rhs primary_value call_op tIDENTIFIERtIDENTIFIER tOP_ASGNtOP_ASGN lex_ctxt arg_rhs primary_value call_op tCONSTANTtCONSTANT tOP_ASGNtOP_ASGN lex_ctxt arg_rhs primary_value tCOLON2tCOLON2 tIDENTIFIERtIDENTIFIER tOP_ASGNtOP_ASGN lex_ctxt arg_rhs primary_value tCOLON2tCOLON2 tCONSTANTtCONSTANT tOP_ASGNtOP_ASGN lex_ctxt arg_rhs tCOLON3tCOLON3 tCONSTANTtCONSTANT tOP_ASGNtOP_ASGN lex_ctxt arg_rhs backref tOP_ASGNtOP_ASGN lex_ctxt arg_rhs arg tDOT2tDOT2 arg arg tDOT3tDOT3 arg arg tDOT2tDOT2 arg tDOT3tDOT3 tBDOT2tBDOT2 arg tBDOT3tBDOT3 arg arg '+''+' arg arg '-''-' arg arg '*''*' arg arg '/''/' arg arg '%''%' arg arg tPOWtPOW arg tUMINUS_NUMtUMINUS_NUM simple_numeric tPOWtPOW arg tUPLUStUPLUS arg tUMINUStUMINUS arg arg '|''|' arg arg '^''^' arg arg '&''&' arg arg tCMPtCMP arg rel_expr arg tEQtEQ arg arg tEQQtEQQ arg arg tNEQtNEQ arg arg tMATCHtMATCH arg arg tNMATCHtNMATCH arg '!''!' arg '~''~' arg arg tLSHFTtLSHFT arg arg tRSHFTtRSHFT arg arg tANDOPtANDOP arg arg tOROPtOROP arg keyword_definedkeyword_defined option_'\n' begin_defined arg arg '?''?' arg option_'\n' ':'':' arg defn_head f_opt_paren_args '=''=' endless_arg defs_head f_opt_paren_args '=''=' endless_arg primary
− arg ::= lhs '=' lex_ctxt arg_rhs
−     | var_lhs tOP_ASGN lex_ctxt arg_rhs
−     | primary_value '[' opt_call_args rbracket tOP_ASGN lex_ctxt arg_rhs
−     | primary_value call_op tIDENTIFIER tOP_ASGN lex_ctxt arg_rhs
−     | primary_value call_op tCONSTANT tOP_ASGN lex_ctxt arg_rhs
−     | primary_value tCOLON2 tIDENTIFIER tOP_ASGN lex_ctxt arg_rhs
−     | primary_value tCOLON2 tCONSTANT tOP_ASGN lex_ctxt arg_rhs
−     | tCOLON3 tCONSTANT tOP_ASGN lex_ctxt arg_rhs
−     | backref tOP_ASGN lex_ctxt arg_rhs
−     | arg tDOT2 arg
−     | arg tDOT3 arg
−     | arg tDOT2
−     | arg tDOT3
−     | tBDOT2 arg
−     | tBDOT3 arg
−     | arg '+' arg
−     | arg '-' arg
−     | arg '*' arg
−     | arg '/' arg
−     | arg '%' arg
−     | arg tPOW arg
−     | tUMINUS_NUM simple_numeric tPOW arg
−     | tUPLUS arg
−     | tUMINUS arg
−     | arg '|' arg
−     | arg '^' arg
−     | arg '&' arg
−     | arg tCMP arg
−     | rel_expr
−     | arg tEQ arg
−     | arg tEQQ arg
−     | arg tNEQ arg
−     | arg tMATCH arg
−     | arg tNMATCH arg
−     | '!' arg
−     | '~' arg
−     | arg tLSHFT arg
−     | arg tRSHFT arg
−     | arg tANDOP arg
−     | arg tOROP arg
−     | keyword_defined option_'\n' begin_defined arg
−     | arg '?' arg option_'\n' ':' arg
−     | defn_head f_opt_paren_args '=' endless_arg
−     | defs_head f_opt_paren_args '=' endless_arg
−     | primary

4.0

asgn_arg_rhs op_asgn_arg_rhs range_expr_arg arg '+''+' arg arg '-''-' arg arg '*''*' arg arg '/''/' arg arg '%''%' arg arg tPOWtPOW arg tUMINUS_NUMtUMINUS_NUM simple_numeric tPOWtPOW arg tUPLUStUPLUS arg tUMINUStUMINUS arg arg '|''|' arg arg '^''^' arg arg '&''&' arg arg tCMPtCMP arg rel_expr arg tEQtEQ arg arg tEQQtEQQ arg arg tNEQtNEQ arg arg tMATCHtMATCH arg arg tNMATCHtNMATCH arg '!''!' arg '~''~' arg arg tLSHFTtLSHFT arg arg tRSHFTtRSHFT arg arg tANDOPtANDOP arg arg tOROPtOROP arg keyword_definedkeyword_defined option_'\n' begin_defined arg def_endless_method_endless_arg ternary primary
+ arg ::= asgn_arg_rhs
+     | op_asgn_arg_rhs
+     | range_expr_arg
+     | arg '+' arg
+     | arg '-' arg
+     | arg '*' arg
+     | arg '/' arg
+     | arg '%' arg
+     | arg tPOW arg
+     | tUMINUS_NUM simple_numeric tPOW arg
+     | tUPLUS arg
+     | tUMINUS arg
+     | arg '|' arg
+     | arg '^' arg
+     | arg '&' arg
+     | arg tCMP arg
+     | rel_expr
+     | arg tEQ arg
+     | arg tEQQ arg
+     | arg tNEQ arg
+     | arg tMATCH arg
+     | arg tNMATCH arg
+     | '!' arg
+     | '~' arg
+     | arg tLSHFT arg
+     | arg tRSHFT arg
+     | arg tANDOP arg
+     | arg tOROP arg
+     | keyword_defined option_'\n' begin_defined arg
+     | def_endless_method_endless_arg
+     | ternary
+     | primary
BNF diff
--- 3.4/arg
+++ 4.0/arg
@@ -1,18 +1,6 @@
-arg ::= lhs '=' lex_ctxt arg_rhs
-    | var_lhs tOP_ASGN lex_ctxt arg_rhs
-    | primary_value '[' opt_call_args rbracket tOP_ASGN lex_ctxt arg_rhs
-    | primary_value call_op tIDENTIFIER tOP_ASGN lex_ctxt arg_rhs
-    | primary_value call_op tCONSTANT tOP_ASGN lex_ctxt arg_rhs
-    | primary_value tCOLON2 tIDENTIFIER tOP_ASGN lex_ctxt arg_rhs
-    | primary_value tCOLON2 tCONSTANT tOP_ASGN lex_ctxt arg_rhs
-    | tCOLON3 tCONSTANT tOP_ASGN lex_ctxt arg_rhs
-    | backref tOP_ASGN lex_ctxt arg_rhs
-    | arg tDOT2 arg
-    | arg tDOT3 arg
-    | arg tDOT2
-    | arg tDOT3
-    | tBDOT2 arg
-    | tBDOT3 arg
+arg ::= asgn_arg_rhs
+    | op_asgn_arg_rhs
+    | range_expr_arg
     | arg '+' arg
     | arg '-' arg
     | arg '*' arg
@@ -39,7 +27,6 @@
     | arg tANDOP arg
     | arg tOROP arg
     | keyword_defined option_'\n' begin_defined arg
-    | arg '?' arg option_'\n' ':' arg
-    | defn_head f_opt_paren_args '=' endless_arg
-    | defs_head f_opt_paren_args '=' endless_arg
+    | def_endless_method_endless_arg
+    | ternary
     | primary

arg_value ± Changed

3.4

− arg_value ::= arg

4.0

+ arg_value ::= value_expr_arg
BNF diff
--- 3.4/arg_value
+++ 4.0/arg_value
@@ -1 +1 @@
-arg_value ::= arg
+arg_value ::= value_expr_arg

args_tail ± Changed

3.4

− args_tail ::= f_kwarg_f_kw ',' f_kwrest opt_f_block_arg
−     | f_kwarg_f_kw opt_f_block_arg
−     | f_any_kwrest opt_f_block_arg
−     | f_block_arg
−     | args_forward

4.0

+ args_tail ::= args_tail_basic_arg_value
+     | args_forward
BNF diff
--- 3.4/args_tail
+++ 4.0/args_tail
@@ -1,5 +1,2 @@
-args_tail ::= f_kwarg_f_kw ',' f_kwrest opt_f_block_arg
-    | f_kwarg_f_kw opt_f_block_arg
-    | f_any_kwrest opt_f_block_arg
-    | f_block_arg
+args_tail ::= args_tail_basic_arg_value
     | args_forward

begin_block ± Changed

3.4

− begin_block ::= block_open top_compstmt '}'

4.0

+ begin_block ::= block_open compstmt_top_stmts '}'
BNF diff
--- 3.4/begin_block
+++ 4.0/begin_block
@@ -1 +1 @@
-begin_block ::= block_open top_compstmt '}'
+begin_block ::= block_open compstmt_top_stmts '}'

block_args_tail ± Changed

3.4

− block_args_tail ::= f_kwarg_f_block_kw ',' f_kwrest opt_f_block_arg
−     | f_kwarg_f_block_kw opt_f_block_arg
−     | f_any_kwrest opt_f_block_arg
−     | f_block_arg

4.0

+ block_args_tail ::= args_tail_basic_primary_value
BNF diff
--- 3.4/block_args_tail
+++ 4.0/block_args_tail
@@ -1,4 +1 @@
-block_args_tail ::= f_kwarg_f_block_kw ',' f_kwrest opt_f_block_arg
-    | f_kwarg_f_block_kw opt_f_block_arg
-    | f_any_kwrest opt_f_block_arg
-    | f_block_arg
+block_args_tail ::= args_tail_basic_primary_value

block_call ± Changed

3.4

− block_call ::= command do_block
−     | block_call call_op2 operation2 opt_paren_args
−     | block_call call_op2 operation2 opt_paren_args brace_block
−     | block_call call_op2 operation2 command_args do_block

4.0

+ block_call ::= command do_block
+     | block_call call_op2 operation2 opt_paren_args
+     | block_call call_op2 operation2 opt_paren_args brace_block
+     | block_call call_op2 operation2 command_args do_block
+     | block_call call_op2 paren_args
BNF diff
--- 3.4/block_call
+++ 4.0/block_call
@@ -2,3 +2,4 @@
     | block_call call_op2 operation2 opt_paren_args
     | block_call call_op2 operation2 opt_paren_args brace_block
     | block_call call_op2 operation2 command_args do_block
+    | block_call call_op2 paren_args

block_param ± Changed

3.4

− block_param ::= f_arg ',' f_optarg_primary_value ',' f_rest_arg opt_args_tail_block_args_tail
−     | f_arg ',' f_optarg_primary_value ',' f_rest_arg ',' f_arg opt_args_tail_block_args_tail
−     | f_arg ',' f_optarg_primary_value opt_args_tail_block_args_tail
−     | f_arg ',' f_optarg_primary_value ',' f_arg opt_args_tail_block_args_tail
−     | f_arg ',' f_rest_arg opt_args_tail_block_args_tail
−     | f_arg excessed_comma
−     | f_arg ',' f_rest_arg ',' f_arg opt_args_tail_block_args_tail
−     | f_arg opt_args_tail_block_args_tail
−     | f_optarg_primary_value ',' f_rest_arg opt_args_tail_block_args_tail
−     | f_optarg_primary_value ',' f_rest_arg ',' f_arg opt_args_tail_block_args_tail
−     | f_optarg_primary_value opt_args_tail_block_args_tail
−     | f_optarg_primary_value ',' f_arg opt_args_tail_block_args_tail
−     | f_rest_arg opt_args_tail_block_args_tail
−     | f_rest_arg ',' f_arg opt_args_tail_block_args_tail
−     | block_args_tail

4.0

+ block_param ::= f_arg ',' f_opt_arg_primary_value ',' f_rest_arg opt_args_tail_block_args_tail
+     | f_arg ',' f_opt_arg_primary_value ',' f_rest_arg ',' f_arg opt_args_tail_block_args_tail
+     | f_arg ',' f_opt_arg_primary_value opt_args_tail_block_args_tail
+     | f_arg ',' f_opt_arg_primary_value ',' f_arg opt_args_tail_block_args_tail
+     | f_arg ',' f_rest_arg opt_args_tail_block_args_tail
+     | f_arg excessed_comma
+     | f_arg ',' f_rest_arg ',' f_arg opt_args_tail_block_args_tail
+     | f_arg opt_args_tail_block_args_tail
+     | f_opt_arg_primary_value ',' f_rest_arg opt_args_tail_block_args_tail
+     | f_opt_arg_primary_value ',' f_rest_arg ',' f_arg opt_args_tail_block_args_tail
+     | f_opt_arg_primary_value opt_args_tail_block_args_tail
+     | f_opt_arg_primary_value ',' f_arg opt_args_tail_block_args_tail
+     | f_rest_arg opt_args_tail_block_args_tail
+     | f_rest_arg ',' f_arg opt_args_tail_block_args_tail
+     | block_args_tail
BNF diff
--- 3.4/block_param
+++ 4.0/block_param
@@ -1,15 +1,15 @@
-block_param ::= f_arg ',' f_optarg_primary_value ',' f_rest_arg opt_args_tail_block_args_tail
-    | f_arg ',' f_optarg_primary_value ',' f_rest_arg ',' f_arg opt_args_tail_block_args_tail
-    | f_arg ',' f_optarg_primary_value opt_args_tail_block_args_tail
-    | f_arg ',' f_optarg_primary_value ',' f_arg opt_args_tail_block_args_tail
+block_param ::= f_arg ',' f_opt_arg_primary_value ',' f_rest_arg opt_args_tail_block_args_tail
+    | f_arg ',' f_opt_arg_primary_value ',' f_rest_arg ',' f_arg opt_args_tail_block_args_tail
+    | f_arg ',' f_opt_arg_primary_value opt_args_tail_block_args_tail
+    | f_arg ',' f_opt_arg_primary_value ',' f_arg opt_args_tail_block_args_tail
     | f_arg ',' f_rest_arg opt_args_tail_block_args_tail
     | f_arg excessed_comma
     | f_arg ',' f_rest_arg ',' f_arg opt_args_tail_block_args_tail
     | f_arg opt_args_tail_block_args_tail
-    | f_optarg_primary_value ',' f_rest_arg opt_args_tail_block_args_tail
-    | f_optarg_primary_value ',' f_rest_arg ',' f_arg opt_args_tail_block_args_tail
-    | f_optarg_primary_value opt_args_tail_block_args_tail
-    | f_optarg_primary_value ',' f_arg opt_args_tail_block_args_tail
+    | f_opt_arg_primary_value ',' f_rest_arg opt_args_tail_block_args_tail
+    | f_opt_arg_primary_value ',' f_rest_arg ',' f_arg opt_args_tail_block_args_tail
+    | f_opt_arg_primary_value opt_args_tail_block_args_tail
+    | f_opt_arg_primary_value ',' f_arg opt_args_tail_block_args_tail
     | f_rest_arg opt_args_tail_block_args_tail
     | f_rest_arg ',' f_arg opt_args_tail_block_args_tail
     | block_args_tail

block_param_def ± Changed

3.4

'|''|' opt_bv_decl '|''|' '|''|' block_param opt_bv_decl '|''|'
− block_param_def ::= '|' opt_bv_decl '|'
−     | '|' block_param opt_bv_decl '|'

4.0

+ block_param_def ::= '|' opt_block_param opt_bv_decl '|'
BNF diff
--- 3.4/block_param_def
+++ 4.0/block_param_def
@@ -1,2 +1 @@
-block_param_def ::= '|' opt_bv_decl '|'
-    | '|' block_param opt_bv_decl '|'
+block_param_def ::= '|' opt_block_param opt_bv_decl '|'

bodystmt ± Changed

3.4

− bodystmt ::= compstmt lex_ctxt opt_rescue k_else $@2 compstmt $@3 opt_ensure
−     | compstmt lex_ctxt opt_rescue $@4 opt_ensure

4.0

+ bodystmt ::= compstmt_stmts lex_ctxt opt_rescue k_else $@2 compstmt_stmts $@3 opt_ensure
+     | compstmt_stmts lex_ctxt opt_rescue $@4 opt_ensure
BNF diff
--- 3.4/bodystmt
+++ 4.0/bodystmt
@@ -1,2 +1,2 @@
-bodystmt ::= compstmt lex_ctxt opt_rescue k_else $@2 compstmt $@3 opt_ensure
-    | compstmt lex_ctxt opt_rescue $@4 opt_ensure
+bodystmt ::= compstmt_stmts lex_ctxt opt_rescue k_else $@2 compstmt_stmts $@3 opt_ensure
+    | compstmt_stmts lex_ctxt opt_rescue $@4 opt_ensure

brace_body ± Changed

3.4

− brace_body ::= @27 max_numparam numparam it_id allow_exits opt_block_param compstmt

4.0

+ brace_body ::= @29 max_numparam numparam it_id allow_exits opt_block_param_def compstmt_stmts
BNF diff
--- 3.4/brace_body
+++ 4.0/brace_body
@@ -1 +1 @@
-brace_body ::= @27 max_numparam numparam it_id allow_exits opt_block_param compstmt
+brace_body ::= @29 max_numparam numparam it_id allow_exits opt_block_param_def compstmt_stmts

call_args ± Changed

3.4

− call_args ::= command
−     | args opt_block_arg
−     | assocs opt_block_arg
−     | args ',' assocs opt_block_arg
−     | block_arg

4.0

+ call_args ::= value_expr_command
+     | def_endless_method_endless_command
+     | args opt_block_arg
+     | assocs opt_block_arg
+     | args ',' assocs opt_block_arg
+     | block_arg
BNF diff
--- 3.4/call_args
+++ 4.0/call_args
@@ -1,4 +1,5 @@
-call_args ::= command
+call_args ::= value_expr_command
+    | def_endless_method_endless_command
     | args opt_block_arg
     | assocs opt_block_arg
     | args ',' assocs opt_block_arg

case_body ± Changed

3.4

− case_body ::= k_when case_args then compstmt cases

4.0

+ case_body ::= k_when case_args then compstmt_stmts cases
BNF diff
--- 3.4/case_body
+++ 4.0/case_body
@@ -1 +1 @@
-case_body ::= k_when case_args then compstmt cases
+case_body ::= k_when case_args then compstmt_stmts cases

command_asgn ± Changed

3.4

lhs '=''=' lex_ctxt command_rhs var_lhs tOP_ASGNtOP_ASGN lex_ctxt command_rhs primary_value '[''[' opt_call_args rbracket tOP_ASGNtOP_ASGN lex_ctxt command_rhs primary_value call_op tIDENTIFIERtIDENTIFIER tOP_ASGNtOP_ASGN lex_ctxt command_rhs primary_value call_op tCONSTANTtCONSTANT tOP_ASGNtOP_ASGN lex_ctxt command_rhs primary_value tCOLON2tCOLON2 tCONSTANTtCONSTANT tOP_ASGNtOP_ASGN lex_ctxt command_rhs primary_value tCOLON2tCOLON2 tIDENTIFIERtIDENTIFIER tOP_ASGNtOP_ASGN lex_ctxt command_rhs defn_head f_opt_paren_args '=''=' endless_command defs_head f_opt_paren_args '=''=' endless_command backref tOP_ASGNtOP_ASGN lex_ctxt command_rhs
− command_asgn ::= lhs '=' lex_ctxt command_rhs
−     | var_lhs tOP_ASGN lex_ctxt command_rhs
−     | primary_value '[' opt_call_args rbracket tOP_ASGN lex_ctxt command_rhs
−     | primary_value call_op tIDENTIFIER tOP_ASGN lex_ctxt command_rhs
−     | primary_value call_op tCONSTANT tOP_ASGN lex_ctxt command_rhs
−     | primary_value tCOLON2 tCONSTANT tOP_ASGN lex_ctxt command_rhs
−     | primary_value tCOLON2 tIDENTIFIER tOP_ASGN lex_ctxt command_rhs
−     | defn_head f_opt_paren_args '=' endless_command
−     | defs_head f_opt_paren_args '=' endless_command
−     | backref tOP_ASGN lex_ctxt command_rhs

4.0

+ command_asgn ::= asgn_command_rhs
+     | op_asgn_command_rhs
+     | def_endless_method_endless_command
BNF diff
--- 3.4/command_asgn
+++ 4.0/command_asgn
@@ -1,10 +1,3 @@
-command_asgn ::= lhs '=' lex_ctxt command_rhs
-    | var_lhs tOP_ASGN lex_ctxt command_rhs
-    | primary_value '[' opt_call_args rbracket tOP_ASGN lex_ctxt command_rhs
-    | primary_value call_op tIDENTIFIER tOP_ASGN lex_ctxt command_rhs
-    | primary_value call_op tCONSTANT tOP_ASGN lex_ctxt command_rhs
-    | primary_value tCOLON2 tCONSTANT tOP_ASGN lex_ctxt command_rhs
-    | primary_value tCOLON2 tIDENTIFIER tOP_ASGN lex_ctxt command_rhs
-    | defn_head f_opt_paren_args '=' endless_command
-    | defs_head f_opt_paren_args '=' endless_command
-    | backref tOP_ASGN lex_ctxt command_rhs
+command_asgn ::= asgn_command_rhs
+    | op_asgn_command_rhs
+    | def_endless_method_endless_command

command_rhs ± Changed

3.4

− command_rhs ::= command_call
−     | command_call modifier_rescue after_rescue stmt
−     | command_asgn

4.0

+ command_rhs ::= command_call_value
+     | command_call_value modifier_rescue after_rescue stmt
+     | command_asgn
BNF diff
--- 3.4/command_rhs
+++ 4.0/command_rhs
@@ -1,3 +1,3 @@
-command_rhs ::= command_call
-    | command_call modifier_rescue after_rescue stmt
+command_rhs ::= command_call_value
+    | command_call_value modifier_rescue after_rescue stmt
     | command_asgn

do_body ± Changed

3.4

− do_body ::= @28 max_numparam numparam it_id allow_exits opt_block_param bodystmt

4.0

+ do_body ::= @30 max_numparam numparam it_id allow_exits opt_block_param_def bodystmt
BNF diff
--- 3.4/do_body
+++ 4.0/do_body
@@ -1 +1 @@
-do_body ::= @28 max_numparam numparam it_id allow_exits opt_block_param bodystmt
+do_body ::= @30 max_numparam numparam it_id allow_exits opt_block_param_def bodystmt

expr_value ± Changed

3.4

expr YYerrorYYerror
− expr_value ::= expr
−     | YYerror

4.0

value_expr_expr YYerrorYYerror
+ expr_value ::= value_expr_expr
+     | YYerror
BNF diff
--- 3.4/expr_value
+++ 4.0/expr_value
@@ -1,2 +1,2 @@
-expr_value ::= expr
+expr_value ::= value_expr_expr
     | YYerror

f_args ± Changed

3.4

− f_args ::= f_arg ',' f_optarg_arg_value ',' f_rest_arg opt_args_tail_args_tail
−     | f_arg ',' f_optarg_arg_value ',' f_rest_arg ',' f_arg opt_args_tail_args_tail
−     | f_arg ',' f_optarg_arg_value opt_args_tail_args_tail
−     | f_arg ',' f_optarg_arg_value ',' f_arg opt_args_tail_args_tail
−     | f_arg ',' f_rest_arg opt_args_tail_args_tail
−     | f_arg ',' f_rest_arg ',' f_arg opt_args_tail_args_tail
−     | f_arg opt_args_tail_args_tail
−     | f_optarg_arg_value ',' f_rest_arg opt_args_tail_args_tail
−     | f_optarg_arg_value ',' f_rest_arg ',' f_arg opt_args_tail_args_tail
−     | f_optarg_arg_value opt_args_tail_args_tail
−     | f_optarg_arg_value ',' f_arg opt_args_tail_args_tail
−     | f_rest_arg opt_args_tail_args_tail
−     | f_rest_arg ',' f_arg opt_args_tail_args_tail
−     | args_tail
−     | ε

4.0

+ f_args ::= f_arg ',' f_opt_arg_arg_value ',' f_rest_arg opt_args_tail_args_tail
+     | f_arg ',' f_opt_arg_arg_value ',' f_rest_arg ',' f_arg opt_args_tail_args_tail
+     | f_arg ',' f_opt_arg_arg_value opt_args_tail_args_tail
+     | f_arg ',' f_opt_arg_arg_value ',' f_arg opt_args_tail_args_tail
+     | f_arg ',' f_rest_arg opt_args_tail_args_tail
+     | f_arg ',' f_rest_arg ',' f_arg opt_args_tail_args_tail
+     | f_arg opt_args_tail_args_tail
+     | f_opt_arg_arg_value ',' f_rest_arg opt_args_tail_args_tail
+     | f_opt_arg_arg_value ',' f_rest_arg ',' f_arg opt_args_tail_args_tail
+     | f_opt_arg_arg_value opt_args_tail_args_tail
+     | f_opt_arg_arg_value ',' f_arg opt_args_tail_args_tail
+     | f_rest_arg opt_args_tail_args_tail
+     | f_rest_arg ',' f_arg opt_args_tail_args_tail
+     | args_tail
+     | ε
BNF diff
--- 3.4/f_args
+++ 4.0/f_args
@@ -1,14 +1,14 @@
-f_args ::= f_arg ',' f_optarg_arg_value ',' f_rest_arg opt_args_tail_args_tail
-    | f_arg ',' f_optarg_arg_value ',' f_rest_arg ',' f_arg opt_args_tail_args_tail
-    | f_arg ',' f_optarg_arg_value opt_args_tail_args_tail
-    | f_arg ',' f_optarg_arg_value ',' f_arg opt_args_tail_args_tail
+f_args ::= f_arg ',' f_opt_arg_arg_value ',' f_rest_arg opt_args_tail_args_tail
+    | f_arg ',' f_opt_arg_arg_value ',' f_rest_arg ',' f_arg opt_args_tail_args_tail
+    | f_arg ',' f_opt_arg_arg_value opt_args_tail_args_tail
+    | f_arg ',' f_opt_arg_arg_value ',' f_arg opt_args_tail_args_tail
     | f_arg ',' f_rest_arg opt_args_tail_args_tail
     | f_arg ',' f_rest_arg ',' f_arg opt_args_tail_args_tail
     | f_arg opt_args_tail_args_tail
-    | f_optarg_arg_value ',' f_rest_arg opt_args_tail_args_tail
-    | f_optarg_arg_value ',' f_rest_arg ',' f_arg opt_args_tail_args_tail
-    | f_optarg_arg_value opt_args_tail_args_tail
-    | f_optarg_arg_value ',' f_arg opt_args_tail_args_tail
+    | f_opt_arg_arg_value ',' f_rest_arg opt_args_tail_args_tail
+    | f_opt_arg_arg_value ',' f_rest_arg ',' f_arg opt_args_tail_args_tail
+    | f_opt_arg_arg_value opt_args_tail_args_tail
+    | f_opt_arg_arg_value ',' f_arg opt_args_tail_args_tail
     | f_rest_arg opt_args_tail_args_tail
     | f_rest_arg ',' f_arg opt_args_tail_args_tail
     | args_tail

f_margs ± Changed

3.4

− f_margs ::= f_marg_list
−     | f_marg_list ',' f_rest_marg
−     | f_marg_list ',' f_rest_marg ',' f_marg_list
−     | f_rest_marg
−     | f_rest_marg ',' f_marg_list

4.0

+ f_margs ::= mlhs_items_f_marg
+     | mlhs_items_f_marg ',' f_rest_marg
+     | mlhs_items_f_marg ',' f_rest_marg ',' mlhs_items_f_marg
+     | f_rest_marg
+     | f_rest_marg ',' mlhs_items_f_marg
BNF diff
--- 3.4/f_margs
+++ 4.0/f_margs
@@ -1,5 +1,5 @@
-f_margs ::= f_marg_list
-    | f_marg_list ',' f_rest_marg
-    | f_marg_list ',' f_rest_marg ',' f_marg_list
+f_margs ::= mlhs_items_f_marg
+    | mlhs_items_f_marg ',' f_rest_marg
+    | mlhs_items_f_marg ',' f_rest_marg ',' mlhs_items_f_marg
     | f_rest_marg
-    | f_rest_marg ',' f_marg_list
+    | f_rest_marg ',' mlhs_items_f_marg

fcall ± Changed

3.4

− fcall ::= operation

4.0

tIDENTIFIERtIDENTIFIER tCONSTANTtCONSTANT tFIDtFID
+ fcall ::= tIDENTIFIER
+     | tCONSTANT
+     | tFID
BNF diff
--- 3.4/fcall
+++ 4.0/fcall
@@ -1 +1,3 @@
-fcall ::= operation
+fcall ::= tIDENTIFIER
+    | tCONSTANT
+    | tFID

if_tail ± Changed

3.4

− if_tail ::= opt_else
−     | k_elsif expr_value then compstmt if_tail

4.0

+ if_tail ::= opt_else
+     | k_elsif expr_value then compstmt_stmts if_tail
BNF diff
--- 3.4/if_tail
+++ 4.0/if_tail
@@ -1,2 +1,2 @@
 if_tail ::= opt_else
-    | k_elsif expr_value then compstmt if_tail
+    | k_elsif expr_value then compstmt_stmts if_tail

lambda_body ± Changed

3.4

tLAMBEGtLAMBEG compstmt '}''}' keyword_do_LAMBDAkeyword_do_LAMBDA $@26 bodystmt k_end
− lambda_body ::= tLAMBEG compstmt '}'
−     | keyword_do_LAMBDA $@26 bodystmt k_end

4.0

tLAMBEGtLAMBEG compstmt_stmts '}''}' keyword_do_LAMBDAkeyword_do_LAMBDA $@28 bodystmt k_end
+ lambda_body ::= tLAMBEG compstmt_stmts '}'
+     | keyword_do_LAMBDA $@28 bodystmt k_end
BNF diff
--- 3.4/lambda_body
+++ 4.0/lambda_body
@@ -1,2 +1,2 @@
-lambda_body ::= tLAMBEG compstmt '}'
-    | keyword_do_LAMBDA $@26 bodystmt k_end
+lambda_body ::= tLAMBEG compstmt_stmts '}'
+    | keyword_do_LAMBDA $@28 bodystmt k_end

method_call ± Changed

3.4

− method_call ::= fcall paren_args
−     | primary_value call_op operation2 opt_paren_args
−     | primary_value tCOLON2 operation2 paren_args
−     | primary_value tCOLON2 operation3
−     | primary_value call_op paren_args
−     | primary_value tCOLON2 paren_args
−     | keyword_super paren_args
−     | keyword_super
−     | primary_value '[' opt_call_args rbracket

4.0

+ method_call ::= fcall paren_args
+     | primary_value call_op operation2 opt_paren_args
+     | primary_value tCOLON2 operation2 paren_args
+     | primary_value tCOLON2 operation3
+     | primary_value call_op2 paren_args
+     | keyword_super paren_args
+     | keyword_super
+     | primary_value '[' opt_call_args rbracket
BNF diff
--- 3.4/method_call
+++ 4.0/method_call
@@ -2,8 +2,7 @@
     | primary_value call_op operation2 opt_paren_args
     | primary_value tCOLON2 operation2 paren_args
     | primary_value tCOLON2 operation3
-    | primary_value call_op paren_args
-    | primary_value tCOLON2 paren_args
+    | primary_value call_op2 paren_args
     | keyword_super paren_args
     | keyword_super
     | primary_value '[' opt_call_args rbracket

mlhs_basic ± Changed

3.4

mlhs_head mlhs_head mlhs_item mlhs_head tSTARtSTAR mlhs_node mlhs_head tSTARtSTAR mlhs_node ','',' mlhs_post mlhs_head tSTARtSTAR mlhs_head tSTARtSTAR ','',' mlhs_post tSTARtSTAR mlhs_node tSTARtSTAR mlhs_node ','',' mlhs_post tSTARtSTAR tSTARtSTAR ','',' mlhs_post
− mlhs_basic ::= mlhs_head
−     | mlhs_head mlhs_item
−     | mlhs_head tSTAR mlhs_node
−     | mlhs_head tSTAR mlhs_node ',' mlhs_post
−     | mlhs_head tSTAR
−     | mlhs_head tSTAR ',' mlhs_post
−     | tSTAR mlhs_node
−     | tSTAR mlhs_node ',' mlhs_post
−     | tSTAR
−     | tSTAR ',' mlhs_post

4.0

+ mlhs_basic ::= mlhs_head
+     | mlhs_head mlhs_item
+     | mlhs_head tSTAR mlhs_node
+     | mlhs_head tSTAR mlhs_node ',' mlhs_items_mlhs_item
+     | mlhs_head tSTAR
+     | mlhs_head tSTAR ',' mlhs_items_mlhs_item
+     | tSTAR mlhs_node
+     | tSTAR mlhs_node ',' mlhs_items_mlhs_item
+     | tSTAR
+     | tSTAR ',' mlhs_items_mlhs_item
BNF diff
--- 3.4/mlhs_basic
+++ 4.0/mlhs_basic
@@ -1,10 +1,10 @@
 mlhs_basic ::= mlhs_head
     | mlhs_head mlhs_item
     | mlhs_head tSTAR mlhs_node
-    | mlhs_head tSTAR mlhs_node ',' mlhs_post
+    | mlhs_head tSTAR mlhs_node ',' mlhs_items_mlhs_item
     | mlhs_head tSTAR
-    | mlhs_head tSTAR ',' mlhs_post
+    | mlhs_head tSTAR ',' mlhs_items_mlhs_item
     | tSTAR mlhs_node
-    | tSTAR mlhs_node ',' mlhs_post
+    | tSTAR mlhs_node ',' mlhs_items_mlhs_item
     | tSTAR
-    | tSTAR ',' mlhs_post
+    | tSTAR ',' mlhs_items_mlhs_item

operation2 ± Changed

3.4

− operation2 ::= operation
−     | op

4.0

tIDENTIFIERtIDENTIFIER tCONSTANTtCONSTANT tFIDtFID op
+ operation2 ::= tIDENTIFIER
+     | tCONSTANT
+     | tFID
+     | op
BNF diff
--- 3.4/operation2
+++ 4.0/operation2
@@ -1,2 +1,4 @@
-operation2 ::= operation
+operation2 ::= tIDENTIFIER
+    | tCONSTANT
+    | tFID
     | op

opt_block_param ± Changed

3.4

− opt_block_param ::= none
−     | block_param_def

4.0

+ opt_block_param ::= ε
+     | block_param
BNF diff
--- 3.4/opt_block_param
+++ 4.0/opt_block_param
@@ -1,2 +1,2 @@
-opt_block_param ::= none
-    | block_param_def
+opt_block_param ::= ε
+    | block_param

opt_else ± Changed

3.4

− opt_else ::= none
−     | k_else compstmt

4.0

+ opt_else ::= none
+     | k_else compstmt_stmts
BNF diff
--- 3.4/opt_else
+++ 4.0/opt_else
@@ -1,2 +1,2 @@
 opt_else ::= none
-    | k_else compstmt
+    | k_else compstmt_stmts

opt_rescue ± Changed

3.4

− opt_rescue ::= k_rescue exc_list exc_var then compstmt opt_rescue
−     | none

4.0

+ opt_rescue ::= k_rescue exc_list exc_var then compstmt_stmts opt_rescue
+     | none
BNF diff
--- 3.4/opt_rescue
+++ 4.0/opt_rescue
@@ -1,2 +1,2 @@
-opt_rescue ::= k_rescue exc_list exc_var then compstmt opt_rescue
+opt_rescue ::= k_rescue exc_list exc_var then compstmt_stmts opt_rescue
     | none

p_case_body ± Changed

3.4

− p_case_body ::= keyword_in p_in_kwarg p_pvtbl p_pktbl p_top_expr then $@29 compstmt p_cases

4.0

+ p_case_body ::= keyword_in p_in_kwarg p_pvtbl p_pktbl p_top_expr then $@31 compstmt_stmts p_cases
BNF diff
--- 3.4/p_case_body
+++ 4.0/p_case_body
@@ -1 +1 @@
-p_case_body ::= keyword_in p_in_kwarg p_pvtbl p_pktbl p_top_expr then $@29 compstmt p_cases
+p_case_body ::= keyword_in p_in_kwarg p_pvtbl p_pktbl p_top_expr then $@31 compstmt_stmts p_cases

p_value ± Changed

3.4

− p_value ::= p_primitive
−     | p_primitive tDOT2 p_primitive
−     | p_primitive tDOT3 p_primitive
−     | p_primitive tDOT2
−     | p_primitive tDOT3
−     | p_var_ref
−     | p_expr_ref
−     | p_const
−     | tBDOT2 p_primitive
−     | tBDOT3 p_primitive

4.0

+ p_value ::= p_primitive
+     | range_expr_p_primitive
+     | p_var_ref
+     | p_expr_ref
+     | p_const
BNF diff
--- 3.4/p_value
+++ 4.0/p_value
@@ -1,10 +1,5 @@
 p_value ::= p_primitive
-    | p_primitive tDOT2 p_primitive
-    | p_primitive tDOT3 p_primitive
-    | p_primitive tDOT2
-    | p_primitive tDOT3
+    | range_expr_p_primitive
     | p_var_ref
     | p_expr_ref
     | p_const
-    | tBDOT2 p_primitive
-    | tBDOT3 p_primitive

primary ± Changed

3.4

− primary ::= literal
−     | strings
−     | xstring
−     | regexp
−     | words
−     | qwords
−     | symbols
−     | qsymbols
−     | var_ref
−     | backref
−     | tFID
−     | k_begin $@14 bodystmt k_end
−     | tLPAREN_ARG compstmt $@15 ')'
−     | tLPAREN compstmt ')'
−     | primary_value tCOLON2 tCONSTANT
−     | tCOLON3 tCONSTANT
−     | tLBRACK aref_args ']'
−     | tLBRACE assoc_list '}'
−     | k_return
−     | k_yield '(' call_args rparen
−     | k_yield '(' rparen
−     | k_yield
−     | keyword_defined option_'\n' '(' begin_defined expr rparen
−     | keyword_not '(' expr rparen
−     | keyword_not '(' rparen
−     | fcall brace_block
−     | method_call
−     | method_call brace_block
−     | lambda
−     | k_if expr_value then compstmt if_tail k_end
−     | k_unless expr_value then compstmt opt_else k_end
−     | k_while expr_value_do compstmt k_end
−     | k_until expr_value_do compstmt k_end
−     | k_case expr_value option_terms @16 case_body k_end
−     | k_case option_terms @17 case_body k_end
−     | k_case expr_value option_terms p_case_body k_end
−     | k_for for_var keyword_in expr_value_do compstmt k_end
−     | k_class cpath superclass $@18 bodystmt k_end
−     | k_class tLSHFT expr_value $@19 term bodystmt k_end
−     | k_module cpath $@20 bodystmt k_end
−     | defn_head f_arglist $@21 bodystmt k_end
−     | defs_head f_arglist $@22 bodystmt k_end
−     | keyword_break
−     | keyword_next
−     | keyword_redo
−     | keyword_retry

4.0

+ primary ::= literal
+     | strings
+     | xstring
+     | regexp
+     | words
+     | qwords
+     | symbols
+     | qsymbols
+     | var_ref
+     | backref
+     | tFID
+     | k_begin $@14 bodystmt k_end
+     | tLPAREN_ARG compstmt_stmts $@15 ')'
+     | tLPAREN compstmt_stmts ')'
+     | primary_value tCOLON2 tCONSTANT
+     | tCOLON3 tCONSTANT
+     | tLBRACK aref_args ']'
+     | tLBRACE assoc_list '}'
+     | k_return
+     | k_yield '(' call_args rparen
+     | k_yield '(' rparen
+     | k_yield
+     | keyword_defined option_'\n' '(' begin_defined expr rparen
+     | keyword_not '(' expr rparen
+     | keyword_not '(' rparen
+     | fcall brace_block
+     | method_call
+     | method_call brace_block
+     | lambda
+     | k_if expr_value then compstmt_stmts if_tail k_end
+     | k_unless expr_value then compstmt_stmts opt_else k_end
+     | k_while expr_value_do compstmt_stmts k_end
+     | k_until expr_value_do compstmt_stmts k_end
+     | k_case expr_value option_terms @16 case_body k_end
+     | k_case option_terms @17 case_body k_end
+     | k_case expr_value option_terms p_case_body k_end
+     | k_for for_var keyword_in $@18 expr_value do $@19 compstmt_stmts k_end
+     | k_class cpath superclass $@20 bodystmt k_end
+     | k_class tLSHFT expr_value $@21 term bodystmt k_end
+     | k_module cpath $@22 bodystmt k_end
+     | defn_head f_arglist $@23 bodystmt k_end
+     | defs_head f_arglist $@24 bodystmt k_end
+     | keyword_break
+     | keyword_next
+     | keyword_redo
+     | keyword_retry
BNF diff
--- 3.4/primary
+++ 4.0/primary
@@ -10,8 +10,8 @@
     | backref
     | tFID
     | k_begin $@14 bodystmt k_end
-    | tLPAREN_ARG compstmt $@15 ')'
-    | tLPAREN compstmt ')'
+    | tLPAREN_ARG compstmt_stmts $@15 ')'
+    | tLPAREN compstmt_stmts ')'
     | primary_value tCOLON2 tCONSTANT
     | tCOLON3 tCONSTANT
     | tLBRACK aref_args ']'
@@ -27,19 +27,19 @@
     | method_call
     | method_call brace_block
     | lambda
-    | k_if expr_value then compstmt if_tail k_end
-    | k_unless expr_value then compstmt opt_else k_end
-    | k_while expr_value_do compstmt k_end
-    | k_until expr_value_do compstmt k_end
+    | k_if expr_value then compstmt_stmts if_tail k_end
+    | k_unless expr_value then compstmt_stmts opt_else k_end
+    | k_while expr_value_do compstmt_stmts k_end
+    | k_until expr_value_do compstmt_stmts k_end
     | k_case expr_value option_terms @16 case_body k_end
     | k_case option_terms @17 case_body k_end
     | k_case expr_value option_terms p_case_body k_end
-    | k_for for_var keyword_in expr_value_do compstmt k_end
-    | k_class cpath superclass $@18 bodystmt k_end
-    | k_class tLSHFT expr_value $@19 term bodystmt k_end
-    | k_module cpath $@20 bodystmt k_end
-    | defn_head f_arglist $@21 bodystmt k_end
-    | defs_head f_arglist $@22 bodystmt k_end
+    | k_for for_var keyword_in $@18 expr_value do $@19 compstmt_stmts k_end
+    | k_class cpath superclass $@20 bodystmt k_end
+    | k_class tLSHFT expr_value $@21 term bodystmt k_end
+    | k_module cpath $@22 bodystmt k_end
+    | defn_head f_arglist $@23 bodystmt k_end
+    | defs_head f_arglist $@24 bodystmt k_end
     | keyword_break
     | keyword_next
     | keyword_redo

primary_value ± Changed

3.4

− primary_value ::= primary

4.0

+ primary_value ::= value_expr_primary
BNF diff
--- 3.4/primary_value
+++ 4.0/primary_value
@@ -1 +1 @@
-primary_value ::= primary
+primary_value ::= value_expr_primary

program ± Changed

3.4

− program ::= $@1 top_compstmt

4.0

+ program ::= $@1 compstmt_top_stmts
BNF diff
--- 3.4/program
+++ 4.0/program
@@ -1 +1 @@
-program ::= $@1 top_compstmt
+program ::= $@1 compstmt_top_stmts

singleton ± Changed

3.4

− singleton ::= var_ref
−     | '(' $@37 expr rparen

4.0

+ singleton ::= value_expr_singleton_expr
BNF diff
--- 3.4/singleton
+++ 4.0/singleton
@@ -1,2 +1 @@
-singleton ::= var_ref
-    | '(' $@37 expr rparen
+singleton ::= value_expr_singleton_expr

stmt ± Changed

3.4

keyword_aliaskeyword_alias fitem $@6 fitem keyword_aliaskeyword_alias tGVARtGVAR tGVARtGVAR keyword_aliaskeyword_alias tGVARtGVAR tBACK_REFtBACK_REF keyword_aliaskeyword_alias tGVARtGVAR tNTH_REFtNTH_REF keyword_undefkeyword_undef undef_list stmt modifier_ifmodifier_if expr_value stmt modifier_unlessmodifier_unless expr_value stmt modifier_whilemodifier_while expr_value stmt modifier_untilmodifier_until expr_value stmt modifier_rescuemodifier_rescue after_rescue stmt k_END allow_exits '{''{' compstmt '}''}' command_asgn mlhs '=''=' lex_ctxt command_call lhs '=''=' lex_ctxt mrhs mlhs '=''=' lex_ctxt mrhs_arg modifier_rescuemodifier_rescue after_rescue stmt mlhs '=''=' lex_ctxt mrhs_arg expr YYerrorYYerror
− stmt ::= keyword_alias fitem $@6 fitem
−     | keyword_alias tGVAR tGVAR
−     | keyword_alias tGVAR tBACK_REF
−     | keyword_alias tGVAR tNTH_REF
−     | keyword_undef undef_list
−     | stmt modifier_if expr_value
−     | stmt modifier_unless expr_value
−     | stmt modifier_while expr_value
−     | stmt modifier_until expr_value
−     | stmt modifier_rescue after_rescue stmt
−     | k_END allow_exits '{' compstmt '}'
−     | command_asgn
−     | mlhs '=' lex_ctxt command_call
−     | lhs '=' lex_ctxt mrhs
−     | mlhs '=' lex_ctxt mrhs_arg modifier_rescue after_rescue stmt
−     | mlhs '=' lex_ctxt mrhs_arg
−     | expr
−     | YYerror

4.0

keyword_aliaskeyword_alias fitem $@6 fitem keyword_aliaskeyword_alias tGVARtGVAR tGVARtGVAR keyword_aliaskeyword_alias tGVARtGVAR tBACK_REFtBACK_REF keyword_aliaskeyword_alias tGVARtGVAR tNTH_REFtNTH_REF keyword_undefkeyword_undef undef_list stmt modifier_ifmodifier_if expr_value stmt modifier_unlessmodifier_unless expr_value stmt modifier_whilemodifier_while expr_value stmt modifier_untilmodifier_until expr_value stmt modifier_rescuemodifier_rescue after_rescue stmt k_END allow_exits '{''{' compstmt_stmts '}''}' command_asgn mlhs '=''=' lex_ctxt command_call_value asgn_mrhs mlhs '=''=' lex_ctxt mrhs_arg modifier_rescuemodifier_rescue after_rescue stmt mlhs '=''=' lex_ctxt mrhs_arg expr YYerrorYYerror
+ stmt ::= keyword_alias fitem $@6 fitem
+     | keyword_alias tGVAR tGVAR
+     | keyword_alias tGVAR tBACK_REF
+     | keyword_alias tGVAR tNTH_REF
+     | keyword_undef undef_list
+     | stmt modifier_if expr_value
+     | stmt modifier_unless expr_value
+     | stmt modifier_while expr_value
+     | stmt modifier_until expr_value
+     | stmt modifier_rescue after_rescue stmt
+     | k_END allow_exits '{' compstmt_stmts '}'
+     | command_asgn
+     | mlhs '=' lex_ctxt command_call_value
+     | asgn_mrhs
+     | mlhs '=' lex_ctxt mrhs_arg modifier_rescue after_rescue stmt
+     | mlhs '=' lex_ctxt mrhs_arg
+     | expr
+     | YYerror
BNF diff
--- 3.4/stmt
+++ 4.0/stmt
@@ -8,10 +8,10 @@
     | stmt modifier_while expr_value
     | stmt modifier_until expr_value
     | stmt modifier_rescue after_rescue stmt
-    | k_END allow_exits '{' compstmt '}'
+    | k_END allow_exits '{' compstmt_stmts '}'
     | command_asgn
-    | mlhs '=' lex_ctxt command_call
-    | lhs '=' lex_ctxt mrhs
+    | mlhs '=' lex_ctxt command_call_value
+    | asgn_mrhs
     | mlhs '=' lex_ctxt mrhs_arg modifier_rescue after_rescue stmt
     | mlhs '=' lex_ctxt mrhs_arg
     | expr

string_content ± Changed

3.4

tSTRING_CONTENTtSTRING_CONTENT tSTRING_DVARtSTRING_DVAR @31 string_dvar tSTRING_DBEGtSTRING_DBEG @32 @33 @34 compstmt string_dend
− string_content ::= tSTRING_CONTENT
−     | tSTRING_DVAR @31 string_dvar
−     | tSTRING_DBEG @32 @33 @34 compstmt string_dend

4.0

tSTRING_CONTENTtSTRING_CONTENT tSTRING_DVARtSTRING_DVAR @34 string_dvar tSTRING_DBEGtSTRING_DBEG @35 @36 @37 compstmt_stmts string_dend
+ string_content ::= tSTRING_CONTENT
+     | tSTRING_DVAR @34 string_dvar
+     | tSTRING_DBEG @35 @36 @37 compstmt_stmts string_dend
BNF diff
--- 3.4/string_content
+++ 4.0/string_content
@@ -1,3 +1,3 @@
 string_content ::= tSTRING_CONTENT
-    | tSTRING_DVAR @31 string_dvar
-    | tSTRING_DBEG @32 @33 @34 compstmt string_dend
+    | tSTRING_DVAR @34 string_dvar
+    | tSTRING_DBEG @35 @36 @37 compstmt_stmts string_dend

lhs ± Reordered

3.4

user_variable keyword_variable primary_value '[''[' opt_call_args rbracket primary_value call_op tIDENTIFIERtIDENTIFIER primary_value tCOLON2tCOLON2 tIDENTIFIERtIDENTIFIER primary_value call_op tCONSTANTtCONSTANT primary_value tCOLON2tCOLON2 tCONSTANTtCONSTANT tCOLON3tCOLON3 tCONSTANTtCONSTANT backref
− lhs ::= user_variable
−     | keyword_variable
−     | primary_value '[' opt_call_args rbracket
−     | primary_value call_op tIDENTIFIER
−     | primary_value tCOLON2 tIDENTIFIER
−     | primary_value call_op tCONSTANT
−     | primary_value tCOLON2 tCONSTANT
−     | tCOLON3 tCONSTANT
−     | backref

4.0

user_variable keyword_variable primary_value '[''[' opt_call_args rbracket primary_value call_op tIDENTIFIERtIDENTIFIER primary_value call_op tCONSTANTtCONSTANT primary_value tCOLON2tCOLON2 tIDENTIFIERtIDENTIFIER primary_value tCOLON2tCOLON2 tCONSTANTtCONSTANT tCOLON3tCOLON3 tCONSTANTtCONSTANT backref
+ lhs ::= user_variable
+     | keyword_variable
+     | primary_value '[' opt_call_args rbracket
+     | primary_value call_op tIDENTIFIER
+     | primary_value call_op tCONSTANT
+     | primary_value tCOLON2 tIDENTIFIER
+     | primary_value tCOLON2 tCONSTANT
+     | tCOLON3 tCONSTANT
+     | backref

mlhs_node ± Reordered

3.4

user_variable keyword_variable primary_value '[''[' opt_call_args rbracket primary_value call_op tIDENTIFIERtIDENTIFIER primary_value tCOLON2tCOLON2 tIDENTIFIERtIDENTIFIER primary_value call_op tCONSTANTtCONSTANT primary_value tCOLON2tCOLON2 tCONSTANTtCONSTANT tCOLON3tCOLON3 tCONSTANTtCONSTANT backref
− mlhs_node ::= user_variable
−     | keyword_variable
−     | primary_value '[' opt_call_args rbracket
−     | primary_value call_op tIDENTIFIER
−     | primary_value tCOLON2 tIDENTIFIER
−     | primary_value call_op tCONSTANT
−     | primary_value tCOLON2 tCONSTANT
−     | tCOLON3 tCONSTANT
−     | backref

4.0

user_variable keyword_variable primary_value '[''[' opt_call_args rbracket primary_value call_op tIDENTIFIERtIDENTIFIER primary_value call_op tCONSTANTtCONSTANT primary_value tCOLON2tCOLON2 tIDENTIFIERtIDENTIFIER primary_value tCOLON2tCOLON2 tCONSTANTtCONSTANT tCOLON3tCOLON3 tCONSTANTtCONSTANT backref
+ mlhs_node ::= user_variable
+     | keyword_variable
+     | primary_value '[' opt_call_args rbracket
+     | primary_value call_op tIDENTIFIER
+     | primary_value call_op tCONSTANT
+     | primary_value tCOLON2 tIDENTIFIER
+     | primary_value tCOLON2 tCONSTANT
+     | tCOLON3 tCONSTANT
+     | backref

Keyboard shortcuts

/ focuses search. j and k move between rules. ? opens this help. Escape closes it.