diff options
Diffstat (limited to 'public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html')
| -rw-r--r-- | public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html b/public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html index 25fb3bb..c027417 100644 --- a/public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html +++ b/public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html @@ -119,11 +119,11 @@ a 次のような構文エラーが出力される。 </p> - <pre class="monospaced highlight"><code>20:1: syntax error, unexpected local variable or method, expecting `then' or ';' or '\n' -if true puts 'Hello, World!' end + <pre class="highlight monospaced"><code>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</code></pre> +20:1: syntax error, unexpected `end', expecting end-of-input +...f true puts 'Hello, World!' end</code></pre> <p> 二つ目のメッセージは無視して一つ目を読むと、<code>then</code>か<code>;</code>か改行が来るはずのところ変数だかメソッドだかが現れたことによりエラーとなっているようだ。 @@ -182,7 +182,7 @@ b <a href="https://github.com/ruby/ruby/blob/221ca0f8281d39f0dfdfe13b2448875384bbf735/parse.y#L3961-L3986">https://github.com/ruby/ruby/blob/221ca0f8281d39f0dfdfe13b2448875384bbf735/parse.y#L3961-L3986</a> </p> - <pre class="highlight" language="yacc" linenumbering="unnumbered"><code class="highlight">p_case_body : keyword_in + <pre class="highlight" language="yacc" linenumbering="unnumbered"><code>p_case_body : keyword_in { SET_LEX_STATE(EXPR_BEG|EXPR_LABEL); p->command_start = FALSE; @@ -213,7 +213,7 @@ b 簡略版: </p> - <pre class="highlight" language="yacc" linenumbering="unnumbered"><code class="highlight">p_case_body : keyword_in p_top_expr then compstmt p_cases + <pre class="highlight" language="yacc" linenumbering="unnumbered"><code>p_case_body : keyword_in p_top_expr then compstmt p_cases ;</code></pre> <p> |
