[#1320] [MethodIndex] Bug and question — keiju@... (Keiju ISHITSUKA)

けいじゅ@日本ラショナルソフトウェアです.

32 messages 1998/01/23
[#1321] Re: [MethodIndex] Bug and question — matz@... (Yukihiro Matsumoto) 1998/01/23

まつもと ゆきひろです

[#1323] Re: [MethodIndex] Bug and question — keiju@... (Keiju ISHITSUKA) 1998/01/23

けいじゅ@日本ラショナルソフトウェアです.

[#1332] Re: [MethodIndex] Bug and question — keiju@... (Keiju ISHITSUKA) 1998/01/27

けいじゅ@日本ラショナルソフトウェアです.

[#1333] Re: [MethodIndex] Bug and question — matz@... (Yukihiro Matsumoto) 1998/01/27

まつもと ゆきひろです

[#1334] Re: [MethodIndex] Bug and question — keiju@... (石塚圭樹 ) 1998/01/27

けいじゅ@日本ラショナルソフトウェアです.

[#1351] Re: [MethodIndex] Bug and question — keiju@... (石塚圭樹 ) 1998/01/29

けいじゅ@日本ラショナルソフトウェアです.

[#1353] Re: [MethodIndex] Bug and question — matz@... (Yukihiro Matsumoto) 1998/01/29

まつもと ゆきひろです

[#1354] Re: [MethodIndex] Bug and question — keiju@... (石塚圭樹 ) 1998/01/29

けいじゅ@日本ラショナルソフトウェアです.

[#1355] Re: [MethodIndex] Bug and question — matz@... (Yukihiro Matsumoto) 1998/01/30

まつもと ゆきひろです

[ruby-dev:1189] Re: source line number(=begin)

From: WATANABE Hirofumi <eban@...>
Date: 1998-01-04 10:51:16 UTC
List: ruby-dev #1189
わたなべです.

=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;

In This Thread