From: Yukihiro Matsumoto Date: 2008-10-13T18:29:54+09:00 Subject: [ruby-dev:36713] Re: source file name of 'mismatched indentations' warning in ruby 1.9 まつもと ゆきひろです In message "Re: [ruby-dev:36711] Re: source file name of 'mismatched indentations' warning in ruby 1.9" on Mon, 13 Oct 2008 17:14:03 +0900, "NARUSE, Yui" writes: |> Ruby 1.9にはインデントレベルの整合性を調べて警告を吐くように |> なっているようですが、requireでスクリプトを読み込む際、読み込まれる |> 対象のファイルのインデントがおかしい場合でも、読み込みを行う側の |> スクリプトのファイル名しか表示されません。 |Index: parse.y |=================================================================== |--- parse.y (revision 19769) |+++ parse.y (working copy) |@@ -4856,7 +4856,8 @@ token_info_pop(struct parser_params *parser, const | if (token_info_has_nonspaces(parser, token) || ptinfo->nonspc) { /* |SKIP */ | goto finish; | } |- rb_warning("mismatched indentations: line %d:'%s' and line %d:'%s'", |+ rb_compile_warning(ruby_sourcefile, 0, |+ "mismatched indentations: line %d:'%s' and line %d:'%s'", | ptinfo->linenum, ptinfo->token, linenum, token); | | finish: | |こんな感じですかね。 コミットしてください。