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

ruby-changes:39490

From: nagachika <ko1@a...>
Date: Fri, 14 Aug 2015 15:21:05 +0900 (JST)
Subject: [ruby-changes:39490] nagachika:r51571 (ruby_2_2): merge revision(s) 50339, 50340, 50342, 50343: [Backport #10705]

nagachika	2015-08-14 15:20:41 +0900 (Fri, 14 Aug 2015)

  New Revision: 51571

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

  Log:
    merge revision(s) 50339,50340,50342,50343: [Backport #10705]
    
    parser.rl: use StringValue
    
    * ext/json/parser/parser.rl (cParser_initialize): use StringValue
      instead of direct rb_convert_type and remove duplicate
      conversion.
    * ext/json/parser/parser.rl: raise with messages in UTF-8
      encoding.  [ruby-core:67386] [Bug #10705]

  Modified directories:
    branches/ruby_2_2/
  Modified files:
    branches/ruby_2_2/ChangeLog
    branches/ruby_2_2/ext/json/parser/extconf.rb
    branches/ruby_2_2/ext/json/parser/parser.c
    branches/ruby_2_2/ext/json/parser/parser.rl
    branches/ruby_2_2/test/json/test_json.rb
    branches/ruby_2_2/version.h
Index: ruby_2_2/ChangeLog
===================================================================
--- ruby_2_2/ChangeLog	(revision 51570)
+++ ruby_2_2/ChangeLog	(revision 51571)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1
+Fri Aug 14 15:09:34 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/json/parser/parser.rl: raise with messages in UTF-8
+	  encoding.  [ruby-core:67386] [Bug #10705]
+
 Fri Aug 14 00:44:34 2015  Eric Wong  <e@8...>
 
 	* io.c (rb_io_oflags_modestr): handle O_TRUNC correctly
Index: ruby_2_2/ext/json/parser/extconf.rb
===================================================================
--- ruby_2_2/ext/json/parser/extconf.rb	(revision 51570)
+++ ruby_2_2/ext/json/parser/extconf.rb	(revision 51571)
@@ -1,3 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/extconf.rb#L1
 require 'mkmf'
 
+have_func("rb_enc_raise", "ruby.h")
+
 create_makefile 'json/ext/parser'
Index: ruby_2_2/ext/json/parser/parser.rl
===================================================================
--- ruby_2_2/ext/json/parser/parser.rl	(revision 51570)
+++ ruby_2_2/ext/json/parser/parser.rl	(revision 51571)
@@ -1,6 +1,28 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.rl#L1
 #include "../fbuffer/fbuffer.h"
 #include "parser.h"
 
+#if defined HAVE_RUBY_ENCODING_H
+# define EXC_ENCODING UTF_8,
+# ifndef HAVE_RB_ENC_RAISE
+static void
+enc_raise(rb_encoding *enc, VALUE exc, const char *fmt, ...)
+{
+    va_list args;
+    VALUE mesg;
+
+    va_start(args, fmt);
+    mesg = rb_enc_vsprintf(enc, fmt, args);
+    va_end(args);
+
+    rb_exc_raise(rb_exc_new3(exc, mesg));
+}
+#   define rb_enc_raise enc_raise
+# endif
+#else
+# define EXC_ENCODING /* nothing */
+# define rb_enc_raise rb_raise
+#endif
+
 /* unicode */
 
 static const char digit_values[256] = {
@@ -66,9 +88,7 @@ static int convert_UTF32_to_UTF8(char *b https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.rl#L88
 }
 
 #ifdef HAVE_RUBY_ENCODING_H
-static VALUE CEncoding_ASCII_8BIT, CEncoding_UTF_8, CEncoding_UTF_16BE,
-    CEncoding_UTF_16LE, CEncoding_UTF_32BE, CEncoding_UTF_32LE;
-static ID i_encoding, i_encode;
+static rb_encoding *UTF_8, *UTF_16BE, *UTF_16LE, *UTF_32BE, *UTF_32LE;
 #else
 static ID i_iconv;
 #endif
@@ -206,14 +226,14 @@ static char *JSON_parse_object(JSON_Pars https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.rl#L226
         if (json->allow_nan) {
             *result = CNaN;
         } else {
-            rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 2);
+            rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p - 2);
         }
     }
     action parse_infinity {
         if (json->allow_nan) {
             *result = CInfinity;
         } else {
-            rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 8);
+            rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p - 8);
         }
     }
     action parse_string {
@@ -229,7 +249,7 @@ static char *JSON_parse_object(JSON_Pars https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.rl#L249
                 fexec p + 10;
                 fhold; fbreak;
             } else {
-                rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+                rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
             }
         }
         np = JSON_parse_float(json, fpc, pe, result);
@@ -396,7 +416,7 @@ static char *JSON_parse_array(JSON_Parse https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.rl#L416
     if(cs >= JSON_array_first_final) {
         return p + 1;
     } else {
-        rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+        rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
         return NULL;
     }
 }
@@ -557,22 +577,22 @@ static VALUE convert_encoding(VALUE sour https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.rl#L577
     }
 #ifdef HAVE_RUBY_ENCODING_H
     {
-        VALUE encoding = rb_funcall(source, i_encoding, 0);
-        if (encoding == CEncoding_ASCII_8BIT) {
+        rb_encoding *enc = rb_enc_get(source);
+        if (enc == rb_ascii8bit_encoding()) {
             if (len >= 4 &&  ptr[0] == 0 && ptr[1] == 0 && ptr[2] == 0) {
-                source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_32BE);
+                source = rb_str_conv_enc(source, UTF_32BE, rb_utf8_encoding());
             } else if (len >= 4 && ptr[0] == 0 && ptr[2] == 0) {
-                source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_16BE);
+                source = rb_str_conv_enc(source, UTF_16BE, rb_utf8_encoding());
             } else if (len >= 4 && ptr[1] == 0 && ptr[2] == 0 && ptr[3] == 0) {
-                source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_32LE);
+                source = rb_str_conv_enc(source, UTF_32LE, rb_utf8_encoding());
             } else if (len >= 4 && ptr[1] == 0 && ptr[3] == 0) {
-                source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_16LE);
+                source = rb_str_conv_enc(source, UTF_16LE, rb_utf8_encoding());
             } else {
                 source = rb_str_dup(source);
                 FORCE_UTF8(source);
             }
         } else {
-            source = rb_funcall(source, i_encode, 1, CEncoding_UTF_8);
+            source = rb_str_conv_enc(source, NULL, rb_utf8_encoding());
         }
     }
 #else
@@ -700,12 +720,11 @@ static VALUE cParser_initialize(int argc https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.rl#L720
         json->object_class = Qnil;
         json->array_class = Qnil;
     }
-    source = rb_convert_type(source, T_STRING, "String", "to_str");
+    StringValue(source);
     if (!json->quirks_mode) {
-      source = convert_encoding(StringValue(source));
+	source = convert_encoding(source);
     }
     json->current_nesting = 0;
-    StringValue(source);
     json->len = RSTRING_LEN(source);
     json->source = RSTRING_PTR(source);;
     json->Vsource = source;
@@ -754,7 +773,7 @@ static VALUE cParser_parse_strict(VALUE https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.rl#L773
     if (cs >= JSON_first_final && p == pe) {
         return result;
     } else {
-        rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+        rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
         return Qnil;
     }
 }
@@ -792,7 +811,7 @@ static VALUE cParser_parse_quirks_mode(V https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.rl#L811
     if (cs >= JSON_quirks_mode_first_final && p == pe) {
         return result;
     } else {
-        rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+        rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
         return Qnil;
     }
 }
@@ -920,14 +939,11 @@ void Init_parser() https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.rl#L939
     i_aref = rb_intern("[]");
     i_leftshift = rb_intern("<<");
 #ifdef HAVE_RUBY_ENCODING_H
-    CEncoding_UTF_8 = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-8"));
-    CEncoding_UTF_16BE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-16be"));
-    CEncoding_UTF_16LE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-16le"));
-    CEncoding_UTF_32BE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-32be"));
-    CEncoding_UTF_32LE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-32le"));
-    CEncoding_ASCII_8BIT = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("ascii-8bit"));
-    i_encoding = rb_intern("encoding");
-    i_encode = rb_intern("encode");
+    UTF_8 = rb_utf8_encoding();
+    UTF_16BE = rb_enc_find("utf-16be");
+    UTF_16LE = rb_enc_find("utf-16le");
+    UTF_32BE = rb_enc_find("utf-32be");
+    UTF_32LE = rb_enc_find("utf-32le");
 #else
     i_iconv = rb_intern("iconv");
 #endif
Index: ruby_2_2/ext/json/parser/parser.c
===================================================================
--- ruby_2_2/ext/json/parser/parser.c	(revision 51570)
+++ ruby_2_2/ext/json/parser/parser.c	(revision 51571)
@@ -3,6 +3,28 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L3
 #include "../fbuffer/fbuffer.h"
 #include "parser.h"
 
+#if defined HAVE_RUBY_ENCODING_H
+# define EXC_ENCODING UTF_8,
+# ifndef HAVE_RB_ENC_RAISE
+static void
+enc_raise(rb_encoding *enc, VALUE exc, const char *fmt, ...)
+{
+    va_list args;
+    VALUE mesg;
+
+    va_start(args, fmt);
+    mesg = rb_enc_vsprintf(enc, fmt, args);
+    va_end(args);
+
+    rb_exc_raise(rb_exc_new3(exc, mesg));
+}
+#   define rb_enc_raise enc_raise
+# endif
+#else
+# define EXC_ENCODING /* nothing */
+# define rb_enc_raise rb_raise
+#endif
+
 /* unicode */
 
 static const char digit_values[256] = {
@@ -68,9 +90,7 @@ static int convert_UTF32_to_UTF8(char *b https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L90
 }
 
 #ifdef HAVE_RUBY_ENCODING_H
-static VALUE CEncoding_ASCII_8BIT, CEncoding_UTF_8, CEncoding_UTF_16BE,
-    CEncoding_UTF_16LE, CEncoding_UTF_32BE, CEncoding_UTF_32LE;
-static ID i_encoding, i_encode;
+static rb_encoding *UTF_8, *UTF_16BE, *UTF_16LE, *UTF_32BE, *UTF_32LE;
 #else
 static ID i_iconv;
 #endif
@@ -84,11 +104,11 @@ static ID i_json_creatable_p, i_json_cre https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L104
           i_match_string, i_aset, i_aref, i_leftshift;
 
 
-#line 110 "parser.rl"
+#line 130 "parser.rl"
 
 
 
-#line 92 "parser.c"
+#line 112 "parser.c"
 enum {JSON_object_start = 1};
 enum {JSON_object_first_final = 27};
 enum {JSON_object_error = 0};
@@ -96,7 +116,7 @@ enum {JSON_object_error = 0}; https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L116
 enum {JSON_object_en_main = 1};
 
 
-#line 151 "parser.rl"
+#line 171 "parser.rl"
 
 
 static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -112,14 +132,14 @@ static char *JSON_parse_object(JSON_Pars https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L132
     *result = NIL_P(object_class) ? rb_hash_new() : rb_class_new_instance(0, 0, object_class);
 
 
-#line 116 "parser.c"
+#line 136 "parser.c"
 	{
 	cs = JSON_object_start;
 	}
 
-#line 166 "parser.rl"
+#line 186 "parser.rl"
 
-#line 123 "parser.c"
+#line 143 "parser.c"
 	{
 	if ( p == pe )
 		goto _test_eof;
@@ -147,7 +167,7 @@ case 2: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L167
 		goto st2;
 	goto st0;
 tr2:
-#line 133 "parser.rl"
+#line 153 "parser.rl"
 	{
         char *np;
         json->parsing_name = 1;
@@ -160,7 +180,7 @@ st3: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L180
 	if ( ++p == pe )
 		goto _test_eof3;
 case 3:
-#line 164 "parser.c"
+#line 184 "parser.c"
 	switch( (*p) ) {
 		case 13: goto st3;
 		case 32: goto st3;
@@ -227,7 +247,7 @@ case 8: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L247
 		goto st8;
 	goto st0;
 tr11:
-#line 118 "parser.rl"
+#line 138 "parser.rl"
 	{
         VALUE v = Qnil;
         char *np = JSON_parse_value(json, p, pe, &v);
@@ -247,7 +267,7 @@ st9: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L267
 	if ( ++p == pe )
 		goto _test_eof9;
 case 9:
-#line 251 "parser.c"
+#line 271 "parser.c"
 	switch( (*p) ) {
 		case 13: goto st9;
 		case 32: goto st9;
@@ -336,14 +356,14 @@ case 18: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L356
 		goto st9;
 	goto st18;
 tr4:
-#line 141 "parser.rl"
+#line 161 "parser.rl"
 	{ p--; {p++; cs = 27; goto _out;} }
 	goto st27;
 st27:
 	if ( ++p == pe )
 		goto _test_eof27;
 case 27:
-#line 347 "parser.c"
+#line 367 "parser.c"
 	goto st0;
 st19:
 	if ( ++p == pe )
@@ -441,7 +461,7 @@ case 26: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L461
 	_out: {}
 	}
 
-#line 167 "parser.rl"
+#line 187 "parser.rl"
 
     if (cs >= JSON_object_first_final) {
         if (json->create_additions) {
@@ -466,7 +486,7 @@ case 26: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L486
 
 
 
-#line 470 "parser.c"
+#line 490 "parser.c"
 enum {JSON_value_start = 1};
 enum {JSON_value_first_final = 21};
 enum {JSON_value_error = 0};
@@ -474,7 +494,7 @@ enum {JSON_value_error = 0}; https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L494
 enum {JSON_value_en_main = 1};
 
 
-#line 271 "parser.rl"
+#line 291 "parser.rl"
 
 
 static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -482,14 +502,14 @@ static char *JSON_parse_value(JSON_Parse https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L502
     int cs = EVIL;
 
 
-#line 486 "parser.c"
+#line 506 "parser.c"
 	{
 	cs = JSON_value_start;
 	}
 
-#line 278 "parser.rl"
+#line 298 "parser.rl"
 
-#line 493 "parser.c"
+#line 513 "parser.c"
 	{
 	if ( p == pe )
 		goto _test_eof;
@@ -514,14 +534,14 @@ st0: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L534
 cs = 0;
 	goto _out;
 tr0:
-#line 219 "parser.rl"
+#line 239 "parser.rl"
 	{
         char *np = JSON_parse_string(json, p, pe, result);
         if (np == NULL) { p--; {p++; cs = 21; goto _out;} } else {p = (( np))-1;}
     }
 	goto st21;
 tr2:
-#line 224 "parser.rl"
+#line 244 "parser.rl"
 	{
         char *np;
         if(pe > p + 9 - json->quirks_mode && !strncmp(MinusInfinity, p, 9)) {
@@ -530,7 +550,7 @@ tr2: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L550
                 {p = (( p + 10))-1;}
                 p--; {p++; cs = 21; goto _out;}
             } else {
-                rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+                rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
             }
         }
         np = JSON_parse_float(json, p, pe, result);
@@ -541,7 +561,7 @@ tr2: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L561
     }
 	goto st21;
 tr5:
-#line 242 "parser.rl"
+#line 262 "parser.rl"
 	{
         char *np;
         json->current_nesting++;
@@ -551,7 +571,7 @@ tr5: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L571
     }
 	goto st21;
 tr9:
-#line 250 "parser.rl"
+#line 270 "parser.rl"
 	{
         char *np;
         json->current_nesting++;
@@ -561,39 +581,39 @@ tr9: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L581
     }
 	goto st21;
 tr16:
-#line 212 "parser.rl"
+#line 232 "parser.rl"
 	{
         if (json->allow_nan) {
             *result = CInfinity;
         } else {
-            rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 8);
+            rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p - 8);
         }
     }
 	goto st21;
 tr18:
-#line 205 "parser.rl"
+#line 225 "parser.rl"
 	{
         if (json->allow_nan) {
             *result = CNaN;
         } else {
-            rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 2);
+            rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p - 2);
         }
     }
 	goto st21;
 tr22:
-#line 199 "parser.rl"
+#line 219 "parser.rl"
 	{
         *result = Qfalse;
     }
 	goto st21;
 tr25:
-#line 196 "parser.rl"
+#line 216 "parser.rl"
 	{
         *result = Qnil;
     }
 	goto st21;
 tr28:
-#line 202 "parser.rl"
+#line 222 "parser.rl"
 	{
         *result = Qtrue;
     }
@@ -602,9 +622,9 @@ st21: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L622
 	if ( ++p == pe )
 		goto _test_eof21;
 case 21:
-#line 258 "parser.rl"
+#line 278 "parser.rl"
 	{ p--; {p++; cs = 21; goto _out;} }
-#line 608 "parser.c"
+#line 628 "parser.c"
 	goto st0;
 st2:
 	if ( ++p == pe )
@@ -765,7 +785,7 @@ case 20: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L785
 	_out: {}
 	}
 
-#line 279 "parser.rl"
+#line 299 "parser.rl"
 
     if (cs >= JSON_value_first_final) {
         return p;
@@ -775,7 +795,7 @@ case 20: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L795
 }
 
 
-#line 779 "parser.c"
+#line 799 "parser.c"
 enum {JSON_integer_start = 1};
 enum {JSON_integer_first_final = 3};
 enum {JSON_integer_error = 0};
@@ -783,7 +803,7 @@ enum {JSON_integer_error = 0}; https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L803
 enum {JSON_integer_en_main = 1};
 
 
-#line 295 "parser.rl"
+#line 315 "parser.rl"
 
 
 static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -791,15 +811,15 @@ static char *JSON_parse_integer(JSON_Par https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L811
     int cs = EVIL;
 
 
-#line 795 "parser.c"
+#line 815 "parser.c"
 	{
 	cs = JSON_integer_start;
 	}
 
-#line 302 "parser.rl"
+#line 322 "parser.rl"
     json->memo = p;
 
-#line 803 "parser.c"
+#line 823 "parser.c"
 	{
 	if ( p == pe )
 		goto _test_eof;
@@ -833,14 +853,14 @@ case 3: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L853
 		goto st0;
 	goto tr4;
 tr4:
-#line 292 "parser.rl"
+#line 312 "parser.rl"
 	{ p--; {p++; cs = 4; goto _out;} }
 	goto st4;
 st4:
 	if ( ++p == pe )
 		goto _test_eof4;
 case 4:
-#line 844 "parser.c"
+#line 864 "parser.c"
 	goto st0;
 st5:
 	if ( ++p == pe )
@@ -859,7 +879,7 @@ case 5: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L879
 	_out: {}
 	}
 
-#line 304 "parser.rl"
+#line 324 "parser.rl"
 
     if (cs >= JSON_integer_first_final) {
         long len = p - json->memo;
@@ -874,7 +894,7 @@ case 5: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L894
 }
 
 
-#line 878 "parser.c"
+#line 898 "parser.c"
 enum {JSON_float_start = 1};
 enum {JSON_float_first_final = 8};
 enum {JSON_float_error = 0};
@@ -882,7 +902,7 @@ enum {JSON_float_error = 0}; https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L902
 enum {JSON_float_en_main = 1};
 
 
-#line 329 "parser.rl"
+#line 349 "parser.rl"
 
 
 static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -890,15 +910,15 @@ static char *JSON_parse_float(JSON_Parse https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L910
     int cs = EVIL;
 
 
-#line 894 "parser.c"
+#line 914 "parser.c"
 	{
 	cs = JSON_float_start;
 	}
 
-#line 336 "parser.rl"
+#line 356 "parser.rl"
     json->memo = p;
 
-#line 902 "parser.c"
+#line 922 "parser.c"
 	{
 	if ( p == pe )
 		goto _test_eof;
@@ -956,14 +976,14 @@ case 8: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L976
 		goto st0;
 	goto tr9;
 tr9:
-#line 323 "parser.rl"
+#line 343 "parser.rl"
 	{ p--; {p++; cs = 9; goto _out;} }
 	goto st9;
 st9:
 	if ( ++p == pe )
 		goto _test_eof9;
 case 9:
-#line 967 "parser.c"
+#line 987 "parser.c"
 	goto st0;
 st5:
 	if ( ++p == pe )
@@ -1024,7 +1044,7 @@ case 7: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L1044
 	_out: {}
 	}
 
-#line 338 "parser.rl"
+#line 358 "parser.rl"
 
     if (cs >= JSON_float_first_final) {
         long len = p - json->memo;
@@ -1040,7 +1060,7 @@ case 7: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/json/parser/parser.c#L1060
 
 
 
-#line 1044 "parser.c"
+#line 1064 "parser.c"
 enum {JSON_array_start = 1};
 enum {JSON_array_first_ (... truncated)

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

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