From: "ujihisa ." Date: 2009-11-30T05:55:17+09:00 Subject: [ruby-dev:39811] [Bug #2407] numeric literal without digits チケット #2407 が更新されました。 (by ujihisa .) ファイル dont_show_unexpected_tIDENTIFIER_error_in_numeric_literal_without_digits.patch 追加 > 0o_, 0x_ などprefixの直後に _ が来た場合には、このエラーを意 > 図的に出しています。_というのは数値表現の数字と数字の間に入る > もので、prefixと数字の間に入るものではない、と考えたからです。 > だとしても"unexpected tIDENTIFIER, expecting $end"ってのは変じゃないですか? というわけで、0o_, 0x_などの場合に"numeric literal without digits"だけ出力して "unexpected tIDENTIFIER, expecting $end"は出力しないようにする小さなパッチを添付します。 0o, 0xだけでなく、ついでに0b, 0dの部分も対応しました。 make testに通ります。 BEFORE: $ ruby192 -e '0x_' -e:1: numeric literal without digits -e:1: syntax error, unexpected tIDENTIFIER, expecting $end AFTER: $ ruby192 -e '0x_' -e:1: numeric literal without digits ---------------------------------------- http://redmine.ruby-lang.org/issues/show/2407 ---------------------------------------- http://redmine.ruby-lang.org