Ruby: 3.4 → 4.0
+31 / −11 / 35 変更
トークン
+
− tRPAREN
args_tail_basic_arg_value + 追加
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_argargs_tail_basic_primary_value + 追加
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_argasgn_arg_rhs + 追加
4.0
+ asgn_arg_rhs ::= lhs '=' lex_ctxt arg_rhsasgn_command_rhs + 追加
4.0
+ asgn_command_rhs ::= lhs '=' lex_ctxt command_rhsasgn_mrhs + 追加
4.0
+ asgn_mrhs ::= lhs '=' lex_ctxt mrhscommand_call_value + 追加
4.0
+ command_call_value ::= value_expr_command_callcompstmt_stmts + 追加
4.0
+ compstmt_stmts ::= stmts option_termscompstmt_top_stmts + 追加
4.0
+ compstmt_top_stmts ::= top_stmts option_termsdef_endless_method_endless_arg + 追加
4.0
+ def_endless_method_endless_arg ::= defn_head f_opt_paren_args '=' endless_arg
+ | defs_head f_opt_paren_args '=' endless_argdef_endless_method_endless_command + 追加
4.0
+ def_endless_method_endless_command ::= defn_head f_opt_paren_args '=' endless_command
+ | defs_head f_opt_paren_args '=' endless_commandf_kw_arg_value + 追加
4.0
+ f_kw_arg_value ::= f_label arg_value
+ | f_labelf_kw_primary_value + 追加
4.0
+ f_kw_primary_value ::= f_label primary_value
+ | f_labelf_kwarg_arg_value + 追加
4.0
+ f_kwarg_arg_value ::= f_kw_arg_value
+ | f_kwarg_arg_value ',' f_kw_arg_valuef_kwarg_primary_value + 追加
4.0
+ f_kwarg_primary_value ::= f_kw_primary_value
+ | f_kwarg_primary_value ',' f_kw_primary_valuef_opt_arg_arg_value + 追加
4.0
+ f_opt_arg_arg_value ::= f_opt_arg_value
+ | f_opt_arg_arg_value ',' f_opt_arg_valuef_opt_arg_primary_value + 追加
4.0
+ f_opt_arg_primary_value ::= f_opt_primary_value
+ | f_opt_arg_primary_value ',' f_opt_primary_valuemlhs_items_f_marg + 追加
4.0
+ mlhs_items_f_marg ::= f_marg
+ | mlhs_items_f_marg ',' f_margmlhs_items_mlhs_item + 追加
4.0
+ mlhs_items_mlhs_item ::= mlhs_item
+ | mlhs_items_mlhs_item ',' mlhs_itemop_asgn_arg_rhs + 追加
4.0
+ 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_rhsop_asgn_command_rhs + 追加
4.0
+ 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_rhsopt_block_param_def + 追加
4.0
+ opt_block_param_def ::= none
+ | block_param_defrange_expr_arg + 追加
4.0
+ range_expr_arg ::= arg tDOT2 arg
+ | arg tDOT3 arg
+ | arg tDOT2
+ | arg tDOT3
+ | tBDOT2 arg
+ | tBDOT3 argrange_expr_p_primitive + 追加
4.0
+ 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_primitivesingleton_expr + 追加
4.0
+ singleton_expr ::= var_ref
+ | '(' $@40 expr rparenternary + 追加
4.0
+ ternary ::= arg '?' arg option_'\n' ':' argvalue_expr_arg + 追加
4.0
+ value_expr_arg ::= argvalue_expr_command + 追加
4.0
+ value_expr_command ::= commandvalue_expr_command_call + 追加
4.0
+ value_expr_command_call ::= command_callvalue_expr_expr + 追加
4.0
+ value_expr_expr ::= exprvalue_expr_primary + 追加
4.0
+ value_expr_primary ::= primaryvalue_expr_singleton_expr + 追加
4.0
+ value_expr_singleton_expr ::= singleton_exprcompstmt − 削除
3.4
− compstmt ::= stmts option_termsf_block_kw − 削除
3.4
− f_block_kw ::= f_label primary_value
− | f_labelf_kw − 削除
3.4
− f_kw ::= f_label arg_value
− | f_labelf_kwarg_f_block_kw − 削除
3.4
− f_kwarg_f_block_kw ::= f_block_kw
− | f_kwarg_f_block_kw ',' f_block_kwf_kwarg_f_kw − 削除
3.4
− f_kwarg_f_kw ::= f_kw
− | f_kwarg_f_kw ',' f_kwf_marg_list − 削除
3.4
− f_marg_list ::= f_marg
− | f_marg_list ',' f_margf_optarg_arg_value − 削除
3.4
− f_optarg_arg_value ::= f_opt_arg_value
− | f_optarg_arg_value ',' f_opt_arg_valuef_optarg_primary_value − 削除
3.4
− f_optarg_primary_value ::= f_opt_primary_value
− | f_optarg_primary_value ',' f_opt_primary_valuemlhs_post − 削除
3.4
− mlhs_post ::= mlhs_item
− | mlhs_post ',' mlhs_itemoperation − 削除
3.4
− operation ::= tIDENTIFIER
− | tCONSTANT
− | tFIDtop_compstmt − 削除
3.4
− top_compstmt ::= top_stmts option_termsarg ± 変更
3.4
− 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
− | primary4.0
+ 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
+ | primaryBNF 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 ± 変更
BNF diff
--- 3.4/arg_value
+++ 4.0/arg_value
@@ -1 +1 @@
-arg_value ::= arg
+arg_value ::= value_expr_arg
args_tail ± 変更
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_forward4.0
+ args_tail ::= args_tail_basic_arg_value
+ | args_forwardBNF 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 ± 変更
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 ± 変更
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_arg4.0
+ block_args_tail ::= args_tail_basic_primary_valueBNF 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 ± 変更
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_block4.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_argsBNF 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 ± 変更
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_tail4.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_tailBNF 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 ± 変更
3.4
− 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 ± 変更
3.4
− bodystmt ::= compstmt lex_ctxt opt_rescue k_else $@2 compstmt $@3 opt_ensure
− | compstmt lex_ctxt opt_rescue $@4 opt_ensure4.0
+ bodystmt ::= compstmt_stmts lex_ctxt opt_rescue k_else $@2 compstmt_stmts $@3 opt_ensure
+ | compstmt_stmts lex_ctxt opt_rescue $@4 opt_ensureBNF 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 ± 変更
3.4
− brace_body ::= @27 max_numparam numparam it_id allow_exits opt_block_param compstmt4.0
+ brace_body ::= @29 max_numparam numparam it_id allow_exits opt_block_param_def compstmt_stmtsBNF 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 ± 変更
3.4
− call_args ::= command
− | args opt_block_arg
− | assocs opt_block_arg
− | args ',' assocs opt_block_arg
− | block_arg4.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_argBNF 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 ± 変更
3.4
− case_body ::= k_when case_args then compstmt cases4.0
+ case_body ::= k_when case_args then compstmt_stmts casesBNF 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 ± 変更
3.4
− 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_rhs4.0
+ command_asgn ::= asgn_command_rhs
+ | op_asgn_command_rhs
+ | def_endless_method_endless_commandBNF 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 ± 変更
3.4
− command_rhs ::= command_call
− | command_call modifier_rescue after_rescue stmt
− | command_asgn4.0
+ command_rhs ::= command_call_value
+ | command_call_value modifier_rescue after_rescue stmt
+ | command_asgnBNF 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 ± 変更
3.4
− do_body ::= @28 max_numparam numparam it_id allow_exits opt_block_param bodystmt4.0
+ do_body ::= @30 max_numparam numparam it_id allow_exits opt_block_param_def bodystmtBNF 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 ± 変更
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 ± 変更
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 ± 変更
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_list4.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_margBNF 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 ± 変更
BNF diff
--- 3.4/fcall
+++ 4.0/fcall
@@ -1 +1,3 @@
-fcall ::= operation
+fcall ::= tIDENTIFIER
+ | tCONSTANT
+ | tFID
if_tail ± 変更
3.4
− if_tail ::= opt_else
− | k_elsif expr_value then compstmt if_tail4.0
+ if_tail ::= opt_else
+ | k_elsif expr_value then compstmt_stmts if_tailBNF 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 ± 変更
3.4
− lambda_body ::= tLAMBEG compstmt '}'
− | keyword_do_LAMBDA $@26 bodystmt k_end4.0
+ lambda_body ::= tLAMBEG compstmt_stmts '}'
+ | keyword_do_LAMBDA $@28 bodystmt k_endBNF 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 ± 変更
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 rbracket4.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 rbracketBNF 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 ± 変更
3.4
− 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_post4.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_itemBNF 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 ± 変更
3.4
− operation2 ::= operation
− | op4.0
+ operation2 ::= tIDENTIFIER
+ | tCONSTANT
+ | tFID
+ | opBNF diff
--- 3.4/operation2
+++ 4.0/operation2
@@ -1,2 +1,4 @@
-operation2 ::= operation
+operation2 ::= tIDENTIFIER
+ | tCONSTANT
+ | tFID
| op
opt_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 ± 変更
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 ± 変更
3.4
− opt_rescue ::= k_rescue exc_list exc_var then compstmt opt_rescue
− | none4.0
+ opt_rescue ::= k_rescue exc_list exc_var then compstmt_stmts opt_rescue
+ | noneBNF 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 ± 変更
3.4
− p_case_body ::= keyword_in p_in_kwarg p_pvtbl p_pktbl p_top_expr then $@29 compstmt p_cases4.0
+ p_case_body ::= keyword_in p_in_kwarg p_pvtbl p_pktbl p_top_expr then $@31 compstmt_stmts p_casesBNF 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 ± 変更
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_primitive4.0
+ p_value ::= p_primitive
+ | range_expr_p_primitive
+ | p_var_ref
+ | p_expr_ref
+ | p_constBNF 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 ± 変更
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_retry4.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_retryBNF 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 ± 変更
BNF diff
--- 3.4/primary_value
+++ 4.0/primary_value
@@ -1 +1 @@
-primary_value ::= primary
+primary_value ::= value_expr_primary
program ± 変更
BNF diff
--- 3.4/program
+++ 4.0/program
@@ -1 +1 @@
-program ::= $@1 top_compstmt
+program ::= $@1 compstmt_top_stmts
singleton ± 変更
BNF diff
--- 3.4/singleton
+++ 4.0/singleton
@@ -1,2 +1 @@
-singleton ::= var_ref
- | '(' $@37 expr rparen
+singleton ::= value_expr_singleton_expr
stmt ± 変更
3.4
− 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
− | YYerror4.0
+ 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
+ | YYerrorBNF 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 ± 変更
3.4
− string_content ::= tSTRING_CONTENT
− | tSTRING_DVAR @31 string_dvar
− | tSTRING_DBEG @32 @33 @34 compstmt string_dend4.0
+ string_content ::= tSTRING_CONTENT
+ | tSTRING_DVAR @34 string_dvar
+ | tSTRING_DBEG @35 @36 @37 compstmt_stmts string_dendBNF 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 ± 並び替え
3.4
− 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
− | backref4.0
+ 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
+ | backrefmlhs_node ± 並び替え
3.4
− 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
− | backref4.0
+ 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