[#7102] Ruby 1.3.4-990611 — Yukihiro Matsumoto <matz@...>

Ruby 1.3.4-990611 is out, check out:

20 messages 1999/06/11

[#7223] Ruby 1.3.4-990625 — Yukihiro Matsumoto <matz@...>

Ruby 1.3.4-990625 is out, check out:

14 messages 1999/06/25
[#7224] -Wl,-rpath on Linux (Re: Ruby 1.3.4-990625) — Ryo HAYASAKA <hayasaka@...21.u-aizu.ac.jp> 1999/06/25

早坂@会津大学です。

[ruby-dev:7214] multibyte identifier

From: Yoshida Masato <yoshidam@...>
Date: 1999-06-24 13:58:08 UTC
List: ruby-dev #7214
よしだです

多バイト文字を含む識別子に関する以下の問題点に対するパッチです。

・識別子の名前が化ける

    print :識別子.id2name, "\n"

・文字列中のインスタンス変数の参照に失敗する

    @変数 = 123
    print "#@変数\n"

・文字列中のグローバル変数の参照がパースエラーになる

    $変数 = 456
    print "#$変数\n"


--- parse.y.org	Thu Jun 24 13:23:57 1999
+++ parse.y	Thu Jun 24 19:11:29 1999
@@ -3165,7 +3165,6 @@
 	if (ismbchar(c)) {
 	    int i, len = mbclen(c)-1;
 
-	    tokadd(c);
 	    for (i = 0; i < len; i++) {
 		c = nextc();
 		tokadd(c);
@@ -3326,7 +3325,21 @@
 		return list;
 	    }
 	}
-	/* through */
+
+	while (is_identchar(c)) {
+	    tokadd(c);
+	    if (ismbchar(c)) {
+		int i, len = mbclen(c)-1;
+
+		for (i = 0; i < len; i++) {
+		    c = nextc();
+		    tokadd(c);
+		}
+	    }
+	    c = nextc();
+	}
+	pushback(c);
+	break;
 
       case '@':
 	tokadd(c);
@@ -3336,7 +3349,6 @@
 	    if (ismbchar(c)) {
 		int i, len = mbclen(c)-1;
 
-		tokadd(c);
 		for (i = 0; i < len; i++) {
 		    c = nextc();
 		    tokadd(c);

-- 
    吉田正人  INS エンジニアリング(株)
              事業開拓室
    yoshidam@inse.co.jp
    yoshidam@yoshidam.net

In This Thread