From: nobu.nakada@... Date: 2002-05-10T18:50:47+09:00 Subject: [ruby-dev:17045] Re: here document2 つで __LINE__ がずれる なかだです。 At Fri, 10 May 2002 17:35:54 +0900, Kazuhiro NISHIYAMA wrote: > 同じ行でhere documentを2つ使うと行番号がずれます。 こんなとこで。 Index: parse.y =================================================================== RCS file: /cvs/ruby/src/ruby/parse.y,v retrieving revision 1.168 diff -u -2 -p -r1.168 parse.y --- parse.y 2002/04/25 13:55:58 1.168 +++ parse.y 2002/05/10 09:47:23 @@ -2878,4 +2878,8 @@ here_document(term, indent) NODE *list = 0; int linesave = ruby_sourceline; + int firstline; + + if (heredoc_end > 0) ruby_sourceline = heredoc_end; + firstline = ruby_sourceline; newtok(); @@ -2979,5 +2983,5 @@ here_document(term, indent) if (list) { - nd_set_line(list, linesave+1); + nd_set_line(list, firstline+1); yylval.node = list; } -- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦