From 2b50e1778b164e641c03c2e77176b6f47ca1e278 Mon Sep 17 00:00:00 2001
From: nsfisis
20:1: syntax error, unexpected local variable or method, expecting `then' or ';' or '\n'
-if true puts 'Hello, World!' end
+ 20:1: syntax error, unexpected local variable or method, expecting `then' or ';' or '\n'
+if true puts 'Hello, World!' end
^~~~
-20:1: syntax error, unexpected `end', expecting end-of-input
-...f true puts 'Hello, World!' end
+20:1: syntax error, unexpected `end', expecting end-of-input
+...f true puts 'Hello, World!' end
二つ目のメッセージは無視して一つ目を読むと、thenか;か改行が来るはずのところ変数だかメソッドだかが現れたことによりエラーとなっているようだ。
@@ -182,7 +182,7 @@ b
https://github.com/ruby/ruby/blob/221ca0f8281d39f0dfdfe13b2448875384bbf735/parse.y#L3961-L3986
p_case_body : keyword_in
+ p_case_body : keyword_in
{
SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
p->command_start = FALSE;
@@ -213,7 +213,7 @@ b
簡略版:
- p_case_body : keyword_in p_top_expr then compstmt p_cases
+ p_case_body : keyword_in p_top_expr then compstmt p_cases
;
--
cgit v1.2.3-70-g09d2