From: WATANABE Hirofumi Date: 1998-01-04T19:51:16+09:00 Subject: [ruby-dev:1189] Re: source line number(=begin) わたなべです. =begin =end や =begin hoge =end が =end を無視してしまいます. こんな感じでいかがでしょう? 1.1b3 orignal からの差分です. -- わたなべひろふみ --- parse.y.orig Mon Dec 22 23:09:32 1997 +++ parse.y Sun Jan 4 19:36:22 1998 @@ -2198,14 +2198,11 @@ if (strncmp(lex_p, "begin", 5) == 0 && isspace(lex_p[5])) { - lex_p = lex_pend; - for (;;) { - if (c == -1) return 0; - c = nextc(); - if (c != '\n') continue; + do { + sourceline++; + lex_p = lex_pend; c = nextc(); + if (c == -1) return 0; if (c != '=') continue; - if (strncmp(lex_p, "end", 3) == 0 && isspace(lex_p[3])) { - lex_p = lex_pend; - break; - } - } + } while (strncmp(lex_p, "end", 3) != 0 || !isspace(lex_p[3])); + sourceline++; + lex_p = lex_pend; goto retry;