From 7b6319986030fc8a2fb5f851a431b5113e774f60 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 15 Mar 2023 02:20:00 +0900 Subject: fix(content): fix XML notations --- content/posts/2021-10-02/ruby-then-keyword-and-case-in.xml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'content/posts/2021-10-02') diff --git a/content/posts/2021-10-02/ruby-then-keyword-and-case-in.xml b/content/posts/2021-10-02/ruby-then-keyword-and-case-in.xml index c3fd933..4176c67 100644 --- a/content/posts/2021-10-02/ruby-then-keyword-and-case-in.xml +++ b/content/posts/2021-10-02/ruby-then-keyword-and-case-in.xml @@ -63,11 +63,15 @@ end を書くことはない。なぜか。次のコードを実行してみるとわかる。 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 + + + 二つ目のメッセージは無視して一つ目を読むと、then; か改行が来るはずのところ変数だかメソッドだかが現れたことによりエラーとなっているようだ。 ポイントは改行が then (や ;) の代わりとなることである。true -- cgit v1.2.3-70-g09d2