[前][次][番号順一覧][スレッド一覧]

ruby-changes:7563

From: akr <ko1@a...>
Date: Wed, 3 Sep 2008 20:03:45 +0900 (JST)
Subject: [ruby-changes:7563] Ruby:r19084 (trunk): * parse.y (parser_encoding_name): defined.

akr	2008-09-03 20:02:11 +0900 (Wed, 03 Sep 2008)

  New Revision: 19084

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19084

  Log:
    * parse.y (parser_encoding_name): defined.
      (parser_tokadd_mbchar): show encoding in the message of
      "invalid multibyte char" error.

  Modified files:
    trunk/ChangeLog
    trunk/parse.y

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 19083)
+++ ChangeLog	(revision 19084)
@@ -1,3 +1,9 @@
+Wed Sep  3 20:01:01 2008  Tanaka Akira  <akr@f...>
+
+	* parse.y (parser_encoding_name): defined.
+	  (parser_tokadd_mbchar): show encoding in the message of
+	  "invalid multibyte char" error.
+
 Wed Sep  3 19:28:04 2008  NAKAMURA Usaku  <usa@r...>
 
 	* vm_insnhelper.c (vm_method_missing): C99.
Index: parse.y
===================================================================
--- parse.y	(revision 19083)
+++ parse.y	(revision 19084)
@@ -4670,6 +4670,7 @@
 # define SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128)
 #endif
 
+#define parser_encoding_name()  (parser->enc->name)
 #define parser_mbclen()  mbclen((lex_p-1),lex_pend,parser->enc)
 #define parser_precise_mbclen()  rb_enc_precise_mbclen((lex_p-1),lex_pend,parser->enc)
 #define is_identchar(p,e,enc) (rb_enc_isalnum(*p,enc) || (*p) == '_' || !ISASCII(*p))
@@ -5498,7 +5499,7 @@
 {
     int len = parser_precise_mbclen();
     if (!MBCLEN_CHARFOUND_P(len)) {
-	compile_error(PARSER_ARG "invalid multibyte char");
+	compile_error(PARSER_ARG "invalid multibyte char (%s)", parser_encoding_name());
 	return -1;
     }
     tokadd(c);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]