From 52e0ab245a1c7d446861f8882f741356b4d24bec Mon Sep 17 00:00:00 2001 From: why Date: Mon, 12 Jan 2004 22:55:09 +0000 Subject: [PATCH] * ext/syck/bytecode.c: turn off default implicit typing. * ext/syck/implicit.c: detect base60 integers. * ext/syck/rubyext.c: handle base60, as well as hex and octal with commas. implicit typing of ruby symbols. * test/yaml/test_yaml.rb: add test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 11 + ext/syck/bytecode.c | 8 +- ext/syck/implicit.c | 2257 ++++++++++++++++++++-------------------- ext/syck/rubyext.c | 122 ++- test/yaml/test_yaml.rb | 8 + 5 files changed, 1253 insertions(+), 1153 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6627531434..08db8688f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Tue Jan 13 07:52:40 2004 why the lucky stiff + + * ext/syck/bytecode.c: turn off default implicit typing. + + * ext/syck/implicit.c: detect base60 integers. + + * ext/syck/rubyext.c: handle base60, as well as hex and octal + with commas. implicit typing of ruby symbols. + + * test/yaml/test_yaml.rb: add test. + Tue Jan 13 04:29:52 2004 Dave Thomas * lib/rdoc/ri/ri_driver.rb (RiDriver::report_method_stuff): diff --git a/ext/syck/bytecode.c b/ext/syck/bytecode.c index df15658a73..eff21d2046 100644 --- a/ext/syck/bytecode.c +++ b/ext/syck/bytecode.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.5 on Sun Nov 23 14:51:02 2003 */ +/* Generated by re2c 0.5 on Mon Jan 12 11:40:10 2004 */ #line 1 "bytecode.re" /* * bytecode.re @@ -510,7 +510,7 @@ yy44: yych = *++YYCURSOR; Directive: { - YYTOKTMP = YYCURSOR; + YYTOKEN = YYCURSOR; { YYCTYPE yych; @@ -611,7 +611,7 @@ yy48: yyaccept = 0; } yy49: #line 400 - { YYCURSOR = YYTOKTMP; + { YYCURSOR = YYTOKEN; return YAML_DOCSEP; } yy50: yych = *++YYCURSOR; @@ -876,7 +876,7 @@ yy58: yych = *++YYCURSOR; Comment: { - YYTOKTMP = YYCURSOR; + YYTOKEN = YYCURSOR; { YYCTYPE yych; diff --git a/ext/syck/implicit.c b/ext/syck/implicit.c index 1dfeac3953..b6f123740f 100644 --- a/ext/syck/implicit.c +++ b/ext/syck/implicit.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.5 on Thu Oct 16 14:12:57 2003 */ +/* Generated by re2c 0.5 on Mon Jan 12 00:56:58 2004 */ #line 1 "implicit.re" /* * implicit.re @@ -91,86 +91,86 @@ yy0: yy2: yych = *++YYCURSOR; if(yych <= '\000') goto yy6; yy3: -#line 116 +#line 119 { return "str"; } yy4: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch(yych){ - case 'o': goto yy163; - case 'u': goto yy191; + case 'o': goto yy168; + case 'u': goto yy196; default: goto yy3; } yy5: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch(yych){ - case 'O': case 'o': goto yy163; - case 'U': goto yy186; - case 'u': goto yy187; + case 'O': case 'o': goto yy168; + case 'U': goto yy191; + case 'u': goto yy192; default: goto yy3; } yy6: yych = *++YYCURSOR; yy7: -#line 82 +#line 83 { return "null"; } yy8: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch(yych){ - case 'r': goto yy184; + case 'r': goto yy189; default: goto yy3; } yy9: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch(yych){ - case 'R': goto yy180; - case 'r': goto yy181; + case 'R': goto yy185; + case 'r': goto yy186; default: goto yy3; } yy10: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch(yych){ - case 'e': goto yy179; + case 'e': goto yy184; default: goto yy3; } yy11: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch(yych){ - case 'E': goto yy177; - case 'e': goto yy178; + case 'E': goto yy182; + case 'e': goto yy183; default: goto yy3; } yy12: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch(yych){ - case 'f': goto yy176; - case 'n': goto yy173; + case 'f': goto yy181; + case 'n': goto yy178; default: goto yy3; } yy13: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch(yych){ - case 'F': goto yy171; - case 'N': case 'n': goto yy173; - case 'f': goto yy172; + case 'F': goto yy176; + case 'N': case 'n': goto yy178; + case 'f': goto yy177; default: goto yy3; } yy14: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch(yych){ - case 'a': goto yy168; + case 'a': goto yy173; default: goto yy3; } yy15: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch(yych){ - case 'A': goto yy159; - case 'a': goto yy160; + case 'A': goto yy164; + case 'a': goto yy165; default: goto yy3; } yy16: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch(yych){ - case '.': goto yy158; - case '0': goto yy149; + case '.': goto yy163; + case '0': goto yy154; case '1': case '2': case '3': @@ -185,8 +185,8 @@ yy16: yyaccept = 0; yy17: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch(yych){ - case '.': goto yy148; - case '0': goto yy149; + case '.': goto yy153; + case '0': goto yy154; case '1': case '2': case '3': @@ -202,7 +202,7 @@ yy18: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch(yych){ case '\000': goto yy51; - case ',': goto yy133; + case ',': goto yy138; case '.': goto yy49; case '0': case '1': @@ -211,10 +211,11 @@ yy18: yyaccept = 0; case '4': case '5': case '6': - case '7': goto yy131; + case '7': goto yy136; case '8': - case '9': goto yy132; - case 'x': goto yy135; + case '9': goto yy137; + case ':': goto yy53; + case 'x': goto yy140; default: goto yy3; } yy19: yyaccept = 0; @@ -233,6 +234,7 @@ yy19: yyaccept = 0; case '7': case '8': case '9': goto yy46; + case ':': goto yy53; default: goto yy3; } yy20: yyaccept = 0; @@ -263,11 +265,11 @@ yy25: YYCURSOR = YYMARKER; } yy26: yych = *++YYCURSOR; yy27: -#line 114 +#line 117 { return "merge"; } yy28: yych = *++YYCURSOR; yy29: -#line 112 +#line 115 { return "default"; } yy30: yych = *++YYCURSOR; switch(yych){ @@ -305,7 +307,7 @@ yy36: yych = *++YYCURSOR; if(yych >= '\001') goto yy25; yy37: yych = *++YYCURSOR; yy38: -#line 98 +#line 101 { return "float#inf"; } yy39: yych = *++YYCURSOR; switch(yych){ @@ -326,7 +328,7 @@ yy42: yych = *++YYCURSOR; if(yych >= '\001') goto yy25; yy43: yych = *++YYCURSOR; yy44: -#line 102 +#line 105 { return "float#nan"; } yy45: yych = *++YYCURSOR; switch(yych){ @@ -344,7 +346,7 @@ yy46: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy65; + case '9': goto yy70; default: goto yy48; } yy47: ++YYCURSOR; @@ -363,15 +365,16 @@ yy48: switch(yych){ case '8': case '9': goto yy47; case '.': goto yy49; + case ':': goto yy53; default: goto yy25; } yy49: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy50: switch(yych){ - case '\000': goto yy55; - case ',': goto yy53; - case '.': goto yy57; + case '\000': goto yy60; + case ',': goto yy58; + case '.': goto yy62; case '0': case '1': case '2': @@ -382,64 +385,34 @@ yy50: switch(yych){ case '7': case '8': case '9': goto yy49; - case 'E': case 'e': goto yy59; + case 'E': case 'e': goto yy64; default: goto yy25; } yy51: yych = *++YYCURSOR; yy52: -#line 92 +#line 95 { return "int"; } yy53: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy54: switch(yych){ - case '\000': goto yy55; - case ',': case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy53; - default: goto yy25; - } -yy55: yych = *++YYCURSOR; -yy56: -#line 94 - { return "float#fix"; } -yy57: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy58: switch(yych){ - case '.': case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy57; - case 'E': case 'e': goto yy59; - default: goto yy25; - } -yy59: yych = *++YYCURSOR; switch(yych){ - case '+': case '-': goto yy60; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': goto yy54; + case '6': + case '7': + case '8': + case '9': goto yy55; default: goto yy25; } -yy60: yych = *++YYCURSOR; - if(yych <= '\000') goto yy25; - goto yy62; -yy61: ++YYCURSOR; +yy54: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy62: switch(yych){ - case '\000': goto yy63; + switch(yych){ + case '\000': goto yy56; case '0': case '1': case '2': @@ -449,15 +422,73 @@ yy62: switch(yych){ case '6': case '7': case '8': - case '9': goto yy61; + case '9': goto yy55; + case ':': goto yy53; default: goto yy25; } -yy63: yych = *++YYCURSOR; -yy64: -#line 96 - { return "float#exp"; } -yy65: yych = *++YYCURSOR; +yy55: ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; switch(yych){ + case '\000': goto yy56; + case ':': goto yy53; + default: goto yy25; + } +yy56: yych = *++YYCURSOR; +yy57: +#line 93 + { return "int#base60"; } +yy58: ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; +yy59: switch(yych){ + case '\000': goto yy60; + case ',': case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy58; + default: goto yy25; + } +yy60: yych = *++YYCURSOR; +yy61: +#line 97 + { return "float#fix"; } +yy62: ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; +yy63: switch(yych){ + case '.': case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy62; + case 'E': case 'e': goto yy64; + default: goto yy25; + } +yy64: yych = *++YYCURSOR; + switch(yych){ + case '+': case '-': goto yy65; + default: goto yy25; + } +yy65: yych = *++YYCURSOR; + if(yych <= '\000') goto yy25; + goto yy67; +yy66: ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; +yy67: switch(yych){ + case '\000': goto yy68; case '0': case '1': case '2': @@ -468,46 +499,12 @@ yy65: yych = *++YYCURSOR; case '7': case '8': case '9': goto yy66; - default: goto yy48; - } -yy66: yych = *++YYCURSOR; - switch(yych){ - case '-': goto yy67; - default: goto yy48; - } -yy67: yych = *++YYCURSOR; - switch(yych){ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy68; default: goto yy25; } yy68: yych = *++YYCURSOR; - switch(yych){ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy69; - default: goto yy25; - } -yy69: yych = *++YYCURSOR; - switch(yych){ - case '-': goto yy70; - default: goto yy25; - } +yy69: +#line 99 + { return "float#exp"; } yy70: yych = *++YYCURSOR; switch(yych){ case '0': @@ -520,25 +517,15 @@ yy70: yych = *++YYCURSOR; case '7': case '8': case '9': goto yy71; - default: goto yy25; + default: goto yy48; } yy71: yych = *++YYCURSOR; switch(yych){ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy72; - default: goto yy25; + case '-': goto yy72; + default: goto yy48; } yy72: yych = *++YYCURSOR; switch(yych){ - case '\000': goto yy73; case '0': case '1': case '2': @@ -548,15 +535,28 @@ yy72: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy25; - case 'T': goto yy75; - case 't': goto yy76; - default: goto yy78; + case '9': goto yy73; + default: goto yy25; } yy73: yych = *++YYCURSOR; -yy74: -#line 104 - { return "timestamp#ymd"; } + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy74; + default: goto yy25; + } +yy74: yych = *++YYCURSOR; + switch(yych){ + case '-': goto yy75; + default: goto yy25; + } yy75: yych = *++YYCURSOR; switch(yych){ case '0': @@ -568,7 +568,7 @@ yy75: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy117; + case '9': goto yy76; default: goto yy25; } yy76: yych = *++YYCURSOR; @@ -582,28 +582,12 @@ yy76: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy99; + case '9': goto yy77; default: goto yy25; } -yy77: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy78: switch(yych){ - case '\t': case ' ': goto yy77; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy79; - default: goto yy25; - } -yy79: yych = *++YYCURSOR; +yy77: yych = *++YYCURSOR; switch(yych){ + case '\000': goto yy78; case '0': case '1': case '2': @@ -613,12 +597,27 @@ yy79: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy80; - default: goto yy25; + case '9': goto yy25; + case 'T': goto yy80; + case 't': goto yy81; + default: goto yy83; } +yy78: yych = *++YYCURSOR; +yy79: +#line 107 + { return "timestamp#ymd"; } yy80: yych = *++YYCURSOR; switch(yych){ - case ':': goto yy81; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy122; default: goto yy25; } yy81: yych = *++YYCURSOR; @@ -632,11 +631,14 @@ yy81: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy82; + case '9': goto yy104; default: goto yy25; } -yy82: yych = *++YYCURSOR; - switch(yych){ +yy82: ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; +yy83: switch(yych){ + case '\t': case ' ': goto yy82; case '0': case '1': case '2': @@ -646,12 +648,7 @@ yy82: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy83; - default: goto yy25; - } -yy83: yych = *++YYCURSOR; - switch(yych){ - case ':': goto yy84; + case '9': goto yy84; default: goto yy25; } yy84: yych = *++YYCURSOR; @@ -670,29 +667,11 @@ yy84: yych = *++YYCURSOR; } yy85: yych = *++YYCURSOR; switch(yych){ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy86; + case ':': goto yy86; default: goto yy25; } yy86: yych = *++YYCURSOR; switch(yych){ - case '\t': case ' ': goto yy89; - case '.': goto yy87; - default: goto yy25; - } -yy87: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy88: switch(yych){ - case '\t': case ' ': goto yy89; case '0': case '1': case '2': @@ -705,19 +684,7 @@ yy88: switch(yych){ case '9': goto yy87; default: goto yy25; } -yy89: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy90: switch(yych){ - case '\t': case ' ': goto yy89; - case '+': case '-': goto yy92; - case 'Z': goto yy91; - default: goto yy25; - } -yy91: yych = *++YYCURSOR; - if(yych <= '\000') goto yy96; - goto yy25; -yy92: yych = *++YYCURSOR; +yy87: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -728,10 +695,15 @@ yy92: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy93; + case '9': goto yy88; default: goto yy25; } -yy93: yych = *++YYCURSOR; +yy88: yych = *++YYCURSOR; + switch(yych){ + case ':': goto yy89; + default: goto yy25; + } +yy89: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -742,34 +714,10 @@ yy93: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy94; + case '9': goto yy90; default: goto yy25; } -yy94: yych = *++YYCURSOR; - switch(yych){ - case '\000': goto yy96; - case ':': goto yy95; - default: goto yy25; - } -yy95: yych = *++YYCURSOR; - switch(yych){ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy98; - default: goto yy25; - } -yy96: yych = *++YYCURSOR; -yy97: -#line 108 - { return "timestamp#spaced"; } -yy98: yych = *++YYCURSOR; +yy90: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -783,7 +731,42 @@ yy98: yych = *++YYCURSOR; case '9': goto yy91; default: goto yy25; } -yy99: yych = *++YYCURSOR; +yy91: yych = *++YYCURSOR; + switch(yych){ + case '\t': case ' ': goto yy94; + case '.': goto yy92; + default: goto yy25; + } +yy92: ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; +yy93: switch(yych){ + case '\t': case ' ': goto yy94; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy92; + default: goto yy25; + } +yy94: ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; +yy95: switch(yych){ + case '\t': case ' ': goto yy94; + case '+': case '-': goto yy97; + case 'Z': goto yy96; + default: goto yy25; + } +yy96: yych = *++YYCURSOR; + if(yych <= '\000') goto yy101; + goto yy25; +yy97: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -794,29 +777,30 @@ yy99: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy100; + case '9': goto yy98; + default: goto yy25; + } +yy98: yych = *++YYCURSOR; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy99; + default: goto yy25; + } +yy99: yych = *++YYCURSOR; + switch(yych){ + case '\000': goto yy101; + case ':': goto yy100; default: goto yy25; } yy100: yych = *++YYCURSOR; - switch(yych){ - case ':': goto yy101; - default: goto yy25; - } -yy101: yych = *++YYCURSOR; - switch(yych){ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy102; - default: goto yy25; - } -yy102: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -830,9 +814,22 @@ yy102: yych = *++YYCURSOR; case '9': goto yy103; default: goto yy25; } +yy101: yych = *++YYCURSOR; +yy102: +#line 111 + { return "timestamp#spaced"; } yy103: yych = *++YYCURSOR; switch(yych){ - case ':': goto yy104; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy96; default: goto yy25; } yy104: yych = *++YYCURSOR; @@ -851,38 +848,11 @@ yy104: yych = *++YYCURSOR; } yy105: yych = *++YYCURSOR; switch(yych){ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy106; + case ':': goto yy106; default: goto yy25; } yy106: yych = *++YYCURSOR; switch(yych){ - case '.': goto yy107; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy25; - default: goto yy108; - } -yy107: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy108: switch(yych){ - case '+': case '-': goto yy110; case '0': case '1': case '2': @@ -893,12 +863,41 @@ yy108: switch(yych){ case '7': case '8': case '9': goto yy107; - case 'Z': goto yy109; + default: goto yy25; + } +yy107: yych = *++YYCURSOR; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy108; + default: goto yy25; + } +yy108: yych = *++YYCURSOR; + switch(yych){ + case ':': goto yy109; default: goto yy25; } yy109: yych = *++YYCURSOR; - if(yych <= '\000') goto yy114; - goto yy25; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy110; + default: goto yy25; + } yy110: yych = *++YYCURSOR; switch(yych){ case '0': @@ -915,6 +914,24 @@ yy110: yych = *++YYCURSOR; } yy111: yych = *++YYCURSOR; switch(yych){ + case '.': goto yy112; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy25; + default: goto yy113; + } +yy112: ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; +yy113: switch(yych){ + case '+': case '-': goto yy115; case '0': case '1': case '2': @@ -925,15 +942,13 @@ yy111: yych = *++YYCURSOR; case '7': case '8': case '9': goto yy112; + case 'Z': goto yy114; default: goto yy25; } -yy112: yych = *++YYCURSOR; - switch(yych){ - case '\000': goto yy114; - case ':': goto yy113; - default: goto yy25; - } -yy113: yych = *++YYCURSOR; +yy114: yych = *++YYCURSOR; + if(yych <= '\000') goto yy119; + goto yy25; +yy115: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -947,10 +962,6 @@ yy113: yych = *++YYCURSOR; case '9': goto yy116; default: goto yy25; } -yy114: yych = *++YYCURSOR; -yy115: -#line 106 - { return "timestamp#iso8601"; } yy116: yych = *++YYCURSOR; switch(yych){ case '0': @@ -962,43 +973,16 @@ yy116: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy109; + case '9': goto yy117; default: goto yy25; } yy117: yych = *++YYCURSOR; switch(yych){ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy118; + case '\000': goto yy119; + case ':': goto yy118; default: goto yy25; } yy118: yych = *++YYCURSOR; - switch(yych){ - case ':': goto yy119; - default: goto yy25; - } -yy119: yych = *++YYCURSOR; - switch(yych){ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy120; - default: goto yy25; - } -yy120: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -1012,9 +996,22 @@ yy120: yych = *++YYCURSOR; case '9': goto yy121; default: goto yy25; } +yy119: yych = *++YYCURSOR; +yy120: +#line 109 + { return "timestamp#iso8601"; } yy121: yych = *++YYCURSOR; switch(yych){ - case ':': goto yy122; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy114; default: goto yy25; } yy122: yych = *++YYCURSOR; @@ -1032,6 +1029,11 @@ yy122: yych = *++YYCURSOR; default: goto yy25; } yy123: yych = *++YYCURSOR; + switch(yych){ + case ':': goto yy124; + default: goto yy25; + } +yy124: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -1042,12 +1044,59 @@ yy123: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy124; + case '9': goto yy125; default: goto yy25; } -yy124: yych = *++YYCURSOR; +yy125: yych = *++YYCURSOR; switch(yych){ - case '.': goto yy125; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy126; + default: goto yy25; + } +yy126: yych = *++YYCURSOR; + switch(yych){ + case ':': goto yy127; + default: goto yy25; + } +yy127: yych = *++YYCURSOR; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy128; + default: goto yy25; + } +yy128: yych = *++YYCURSOR; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy129; + default: goto yy25; + } +yy129: yych = *++YYCURSOR; + switch(yych){ + case '.': goto yy130; case '0': case '1': case '2': @@ -1058,15 +1107,15 @@ yy124: yych = *++YYCURSOR; case '7': case '8': case '9': goto yy25; - case 'Z': goto yy127; - default: goto yy126; + case 'Z': goto yy132; + default: goto yy131; } -yy125: ++YYCURSOR; +yy130: ++YYCURSOR; if((YYLIMIT - YYCURSOR) < 7) YYFILL(7); yych = *YYCURSOR; -yy126: switch(yych){ - case '+': case '-': goto yy110; - case '0': goto yy125; +yy131: switch(yych){ + case '+': case '-': goto yy115; + case '0': goto yy130; case '1': case '2': case '3': @@ -1075,47 +1124,47 @@ yy126: switch(yych){ case '6': case '7': case '8': - case '9': goto yy129; - case 'Z': goto yy109; + case '9': goto yy134; + case 'Z': goto yy114; default: goto yy25; } -yy127: yych = *++YYCURSOR; - if(yych >= '\001') goto yy25; -yy128: yych = *++YYCURSOR; - goto yy115; -yy129: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 7) YYFILL(7); - yych = *YYCURSOR; -yy130: switch(yych){ - case '+': case '-': goto yy110; - case '0': goto yy125; - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy129; - case 'Z': goto yy127; - default: goto yy25; - } -yy131: yych = *++YYCURSOR; - switch(yych){ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': goto yy146; - case '8': - case '9': goto yy144; - default: goto yy134; - } yy132: yych = *++YYCURSOR; + if(yych >= '\001') goto yy25; +yy133: yych = *++YYCURSOR; + goto yy120; +yy134: ++YYCURSOR; + if((YYLIMIT - YYCURSOR) < 7) YYFILL(7); + yych = *YYCURSOR; +yy135: switch(yych){ + case '+': case '-': goto yy115; + case '0': goto yy130; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy134; + case 'Z': goto yy132; + default: goto yy25; + } +yy136: yych = *++YYCURSOR; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': goto yy151; + case '8': + case '9': goto yy149; + default: goto yy139; + } +yy137: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -1126,14 +1175,14 @@ yy132: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy144; - default: goto yy143; + case '9': goto yy149; + default: goto yy148; } -yy133: ++YYCURSOR; +yy138: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy134: switch(yych){ - case '\000': goto yy140; +yy139: switch(yych){ + case '\000': goto yy145; case ',': case '0': case '1': case '2': @@ -1141,20 +1190,21 @@ yy134: switch(yych){ case '4': case '5': case '6': - case '7': goto yy133; + case '7': goto yy138; case '.': goto yy49; case '8': - case '9': goto yy142; + case '9': goto yy147; + case ':': goto yy53; default: goto yy25; } -yy135: yych = *++YYCURSOR; +yy140: yych = *++YYCURSOR; if(yych <= '\000') goto yy25; - goto yy137; -yy136: ++YYCURSOR; + goto yy142; +yy141: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy137: switch(yych){ - case '\000': goto yy138; +yy142: switch(yych){ + case '\000': goto yy143; case ',': case '0': case '1': case '2': @@ -1174,21 +1224,21 @@ yy137: switch(yych){ case 'c': case 'd': case 'e': - case 'f': goto yy136; + case 'f': goto yy141; default: goto yy25; } -yy138: yych = *++YYCURSOR; -yy139: -#line 88 +yy143: yych = *++YYCURSOR; +yy144: +#line 89 { return "int#hex"; } -yy140: yych = *++YYCURSOR; -yy141: -#line 90 +yy145: yych = *++YYCURSOR; +yy146: +#line 91 { return "int#oct"; } -yy142: ++YYCURSOR; +yy147: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy143: switch(yych){ +yy148: switch(yych){ case ',': case '0': case '1': case '2': @@ -1198,11 +1248,12 @@ yy143: switch(yych){ case '6': case '7': case '8': - case '9': goto yy142; + case '9': goto yy147; case '.': goto yy49; + case ':': goto yy53; default: goto yy25; } -yy144: yych = *++YYCURSOR; +yy149: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -1213,15 +1264,15 @@ yy144: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy145; - default: goto yy143; + case '9': goto yy150; + default: goto yy148; } -yy145: yych = *++YYCURSOR; +yy150: yych = *++YYCURSOR; switch(yych){ - case '-': goto yy67; - default: goto yy143; + case '-': goto yy72; + default: goto yy148; } -yy146: yych = *++YYCURSOR; +yy151: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -1230,218 +1281,218 @@ yy146: yych = *++YYCURSOR; case '4': case '5': case '6': - case '7': goto yy147; + case '7': goto yy152; case '8': - case '9': goto yy145; - default: goto yy134; - } -yy147: yych = *++YYCURSOR; - switch(yych){ - case '-': goto yy67; - default: goto yy134; - } -yy148: yych = *++YYCURSOR; - switch(yych){ - case 'I': goto yy151; - case 'i': goto yy150; - default: goto yy25; - } -yy149: yych = *++YYCURSOR; - switch(yych){ - case '\000': goto yy51; - case 'x': goto yy135; - default: goto yy134; - } -yy150: yych = *++YYCURSOR; - switch(yych){ - case 'n': goto yy157; - default: goto yy25; - } -yy151: yych = *++YYCURSOR; - switch(yych){ - case 'N': goto yy152; - case 'n': goto yy153; - default: goto yy25; + case '9': goto yy150; + default: goto yy139; } yy152: yych = *++YYCURSOR; switch(yych){ - case 'F': goto yy154; - default: goto yy25; + case '-': goto yy72; + default: goto yy139; } yy153: yych = *++YYCURSOR; switch(yych){ - case 'f': goto yy154; + case 'I': goto yy156; + case 'i': goto yy155; default: goto yy25; } yy154: yych = *++YYCURSOR; - if(yych >= '\001') goto yy25; + switch(yych){ + case '\000': goto yy51; + case 'x': goto yy140; + default: goto yy139; + } yy155: yych = *++YYCURSOR; -yy156: -#line 100 - { return "float#neginf"; } + switch(yych){ + case 'n': goto yy162; + default: goto yy25; + } +yy156: yych = *++YYCURSOR; + switch(yych){ + case 'N': goto yy157; + case 'n': goto yy158; + default: goto yy25; + } yy157: yych = *++YYCURSOR; switch(yych){ - case 'f': goto yy154; + case 'F': goto yy159; default: goto yy25; } yy158: yych = *++YYCURSOR; + switch(yych){ + case 'f': goto yy159; + default: goto yy25; + } +yy159: yych = *++YYCURSOR; + if(yych >= '\001') goto yy25; +yy160: yych = *++YYCURSOR; +yy161: +#line 103 + { return "float#neginf"; } +yy162: yych = *++YYCURSOR; + switch(yych){ + case 'f': goto yy159; + default: goto yy25; + } +yy163: yych = *++YYCURSOR; switch(yych){ case 'I': goto yy33; case 'i': goto yy32; default: goto yy25; } -yy159: yych = *++YYCURSOR; - switch(yych){ - case 'L': goto yy166; - default: goto yy25; - } -yy160: yych = *++YYCURSOR; - switch(yych){ - case 'l': goto yy161; - default: goto yy25; - } -yy161: yych = *++YYCURSOR; - switch(yych){ - case 's': goto yy162; - default: goto yy25; - } -yy162: yych = *++YYCURSOR; - switch(yych){ - case 'e': goto yy163; - default: goto yy25; - } -yy163: yych = *++YYCURSOR; - if(yych >= '\001') goto yy25; yy164: yych = *++YYCURSOR; -yy165: -#line 86 - { return "bool#no"; } + switch(yych){ + case 'L': goto yy171; + default: goto yy25; + } +yy165: yych = *++YYCURSOR; + switch(yych){ + case 'l': goto yy166; + default: goto yy25; + } yy166: yych = *++YYCURSOR; switch(yych){ - case 'S': goto yy167; + case 's': goto yy167; default: goto yy25; } yy167: yych = *++YYCURSOR; switch(yych){ - case 'E': goto yy163; + case 'e': goto yy168; default: goto yy25; } yy168: yych = *++YYCURSOR; - switch(yych){ - case 'l': goto yy169; - default: goto yy25; - } + if(yych >= '\001') goto yy25; yy169: yych = *++YYCURSOR; - switch(yych){ - case 's': goto yy170; - default: goto yy25; - } -yy170: yych = *++YYCURSOR; - switch(yych){ - case 'e': goto yy163; - default: goto yy25; - } +yy170: +#line 87 + { return "bool#no"; } yy171: yych = *++YYCURSOR; switch(yych){ - case 'F': goto yy163; + case 'S': goto yy172; default: goto yy25; } yy172: yych = *++YYCURSOR; switch(yych){ - case 'f': goto yy163; + case 'E': goto yy168; default: goto yy25; } yy173: yych = *++YYCURSOR; - if(yych >= '\001') goto yy25; + switch(yych){ + case 'l': goto yy174; + default: goto yy25; + } yy174: yych = *++YYCURSOR; -yy175: -#line 84 - { return "bool#yes"; } + switch(yych){ + case 's': goto yy175; + default: goto yy25; + } +yy175: yych = *++YYCURSOR; + switch(yych){ + case 'e': goto yy168; + default: goto yy25; + } yy176: yych = *++YYCURSOR; switch(yych){ - case 'f': goto yy163; + case 'F': goto yy168; default: goto yy25; } yy177: yych = *++YYCURSOR; switch(yych){ - case 'S': goto yy173; + case 'f': goto yy168; default: goto yy25; } yy178: yych = *++YYCURSOR; - switch(yych){ - case 's': goto yy173; - default: goto yy25; - } + if(yych >= '\001') goto yy25; yy179: yych = *++YYCURSOR; - switch(yych){ - case 's': goto yy173; - default: goto yy25; - } -yy180: yych = *++YYCURSOR; - switch(yych){ - case 'U': goto yy183; - default: goto yy25; - } +yy180: +#line 85 + { return "bool#yes"; } yy181: yych = *++YYCURSOR; switch(yych){ - case 'u': goto yy182; + case 'f': goto yy168; default: goto yy25; } yy182: yych = *++YYCURSOR; switch(yych){ - case 'e': goto yy173; + case 'S': goto yy178; default: goto yy25; } yy183: yych = *++YYCURSOR; switch(yych){ - case 'E': goto yy173; + case 's': goto yy178; default: goto yy25; } yy184: yych = *++YYCURSOR; switch(yych){ - case 'u': goto yy185; + case 's': goto yy178; default: goto yy25; } yy185: yych = *++YYCURSOR; switch(yych){ - case 'e': goto yy173; + case 'U': goto yy188; default: goto yy25; } yy186: yych = *++YYCURSOR; switch(yych){ - case 'L': goto yy190; + case 'u': goto yy187; default: goto yy25; } yy187: yych = *++YYCURSOR; switch(yych){ - case 'l': goto yy188; + case 'e': goto yy178; default: goto yy25; } yy188: yych = *++YYCURSOR; switch(yych){ - case 'l': goto yy189; + case 'E': goto yy178; default: goto yy25; } yy189: yych = *++YYCURSOR; - if(yych <= '\000') goto yy6; - goto yy25; + switch(yych){ + case 'u': goto yy190; + default: goto yy25; + } yy190: yych = *++YYCURSOR; switch(yych){ - case 'L': goto yy189; + case 'e': goto yy178; default: goto yy25; } yy191: yych = *++YYCURSOR; switch(yych){ - case 'l': goto yy192; + case 'L': goto yy195; default: goto yy25; } yy192: yych = *++YYCURSOR; switch(yych){ - case 'l': goto yy189; + case 'l': goto yy193; + default: goto yy25; + } +yy193: yych = *++YYCURSOR; + switch(yych){ + case 'l': goto yy194; + default: goto yy25; + } +yy194: yych = *++YYCURSOR; + if(yych <= '\000') goto yy6; + goto yy25; +yy195: yych = *++YYCURSOR; + switch(yych){ + case 'L': goto yy194; + default: goto yy25; + } +yy196: yych = *++YYCURSOR; + switch(yych){ + case 'l': goto yy197; + default: goto yy25; + } +yy197: yych = *++YYCURSOR; + switch(yych){ + case 'l': goto yy194; default: goto yy25; } } -#line 118 +#line 121 } @@ -1457,14 +1508,14 @@ syck_type_id_to_uri( char *type_id ) { YYCTYPE yych; unsigned int yyaccept; - goto yy193; -yy194: ++YYCURSOR; -yy193: + goto yy198; +yy199: ++YYCURSOR; +yy198: if((YYLIMIT - YYCURSOR) < 21) YYFILL(21); yych = *YYCURSOR; switch(yych){ - case '\000': goto yy195; - case '!': goto yy199; + case '\000': goto yy200; + case '!': goto yy204; case '0': case '1': case '2': @@ -1520,22 +1571,22 @@ yy193: case 's': case 'u': case 'v': case 'w': case 'y': - case 'z': goto yy201; - case 't': goto yy196; - case 'x': goto yy198; - default: goto yy202; + case 'z': goto yy206; + case 't': goto yy201; + case 'x': goto yy203; + default: goto yy207; } -yy195: YYCURSOR = YYMARKER; +yy200: YYCURSOR = YYMARKER; switch(yyaccept){ - case 0: goto yy197; + case 0: goto yy202; } -yy196: yyaccept = 0; +yy201: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch(yych){ - case ',': goto yy207; - case '-': goto yy203; - case '.': goto yy208; - case '/': goto yy209; + case ',': goto yy212; + case '-': goto yy208; + case '.': goto yy213; + case '/': goto yy214; case '0': case '1': case '2': @@ -1594,14 +1645,14 @@ yy196: yyaccept = 0; case 'w': case 'x': case 'y': - case 'z': goto yy205; - case 'a': goto yy237; - default: goto yy197; + case 'z': goto yy210; + case 'a': goto yy242; + default: goto yy202; } -yy197: -#line 170 +yy202: +#line 173 { return syck_taguri( YAML_DOMAIN, type_id, strlen( type_id ) ); } -yy198: yyaccept = 0; +yy203: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch(yych){ case ',': case '.': @@ -1665,21 +1716,21 @@ yy198: yyaccept = 0; case 'w': case 'x': case 'y': - case 'z': goto yy206; - case '-': goto yy227; - default: goto yy197; + case 'z': goto yy211; + case '-': goto yy232; + default: goto yy202; } -yy199: yych = *++YYCURSOR; -yy200: -#line 144 +yy204: yych = *++YYCURSOR; +yy205: +#line 147 { return syck_xprivate( type_id + 1, strlen( type_id ) - 1 ); } -yy201: yyaccept = 0; +yy206: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch(yych){ - case ',': goto yy207; - case '-': goto yy203; - case '.': goto yy208; - case '/': goto yy209; + case ',': goto yy212; + case '-': goto yy208; + case '.': goto yy213; + case '/': goto yy214; case '0': case '1': case '2': @@ -1739,165 +1790,165 @@ yy201: yyaccept = 0; case 'w': case 'x': case 'y': - case 'z': goto yy205; - default: goto yy197; - } -yy202: yych = *++YYCURSOR; - goto yy197; -yy203: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy204: switch(yych){ - case '-': goto yy203; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': case '_': case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': goto yy205; - default: goto yy195; - } -yy205: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy206: switch(yych){ - case ',': goto yy207; - case '-': goto yy203; - case '.': goto yy208; - case '/': goto yy209; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': case '_': case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': goto yy205; - default: goto yy195; + case 'z': goto yy210; + default: goto yy202; } yy207: yych = *++YYCURSOR; - switch(yych){ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy215; - default: goto yy195; - } + goto yy202; yy208: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; +yy209: switch(yych){ + case '-': goto yy208; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy210; + default: goto yy200; + } +yy210: ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; +yy211: switch(yych){ + case ',': goto yy212; + case '-': goto yy208; + case '.': goto yy213; + case '/': goto yy214; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy210; + default: goto yy200; + } +yy212: yych = *++YYCURSOR; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy220; + default: goto yy200; + } +yy213: ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; switch(yych){ case '0': case '1': @@ -1958,12 +2009,12 @@ yy208: ++YYCURSOR; case 'w': case 'x': case 'y': - case 'z': goto yy211; - default: goto yy195; + case 'z': goto yy216; + default: goto yy200; } -yy209: yych = *++YYCURSOR; -yy210: -#line 146 +yy214: yych = *++YYCURSOR; +yy215: +#line 149 { char *domain = S_ALLOC_N( char, ( YYCURSOR - type_id ) + 15 ); char *uri; @@ -1976,14 +2027,14 @@ yy210: S_FREE( domain ); return uri; } -yy211: ++YYCURSOR; +yy216: ++YYCURSOR; if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; -yy212: switch(yych){ - case ',': goto yy207; - case '-': goto yy213; - case '.': goto yy208; - case '/': goto yy209; +yy217: switch(yych){ + case ',': goto yy212; + case '-': goto yy218; + case '.': goto yy213; + case '/': goto yy214; case '0': case '1': case '2': @@ -2043,14 +2094,14 @@ yy212: switch(yych){ case 'w': case 'x': case 'y': - case 'z': goto yy211; - default: goto yy195; + case 'z': goto yy216; + default: goto yy200; } -yy213: ++YYCURSOR; +yy218: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy214: switch(yych){ - case '-': goto yy213; +yy219: switch(yych){ + case '-': goto yy218; case '0': case '1': case '2': @@ -2110,10 +2161,10 @@ yy214: switch(yych){ case 'w': case 'x': case 'y': - case 'z': goto yy211; - default: goto yy195; + case 'z': goto yy216; + default: goto yy200; } -yy215: yych = *++YYCURSOR; +yy220: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -2124,44 +2175,10 @@ yy215: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy216; - default: goto yy195; + case '9': goto yy221; + default: goto yy200; } -yy216: yych = *++YYCURSOR; - switch(yych){ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy217; - default: goto yy195; - } -yy217: yych = *++YYCURSOR; - switch(yych){ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy218; - default: goto yy195; - } -yy218: yych = *++YYCURSOR; - switch(yych){ - case '-': goto yy219; - case '/': goto yy220; - default: goto yy195; - } -yy219: yych = *++YYCURSOR; +yy221: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -2173,21 +2190,8 @@ yy219: yych = *++YYCURSOR; case '7': case '8': case '9': goto yy222; - default: goto yy195; + default: goto yy200; } -yy220: yych = *++YYCURSOR; -yy221: -#line 159 - { char *domain = S_ALLOC_N( char, YYCURSOR - type_id ); - char *uri; - - domain[0] = '\0'; - strncat( domain, type_id, ( YYCURSOR - type_id ) - 1 ); - uri = syck_taguri( domain, YYCURSOR, YYLIMIT - YYCURSOR ); - - S_FREE( domain ); - return uri; - } yy222: yych = *++YYCURSOR; switch(yych){ case '0': @@ -2200,13 +2204,13 @@ yy222: yych = *++YYCURSOR; case '7': case '8': case '9': goto yy223; - default: goto yy195; + default: goto yy200; } yy223: yych = *++YYCURSOR; switch(yych){ case '-': goto yy224; - case '/': goto yy220; - default: goto yy195; + case '/': goto yy225; + default: goto yy200; } yy224: yych = *++YYCURSOR; switch(yych){ @@ -2219,10 +2223,23 @@ yy224: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy225; - default: goto yy195; + case '9': goto yy227; + default: goto yy200; } yy225: yych = *++YYCURSOR; +yy226: +#line 162 + { char *domain = S_ALLOC_N( char, YYCURSOR - type_id ); + char *uri; + + domain[0] = '\0'; + strncat( domain, type_id, ( YYCURSOR - type_id ) - 1 ); + uri = syck_taguri( domain, YYCURSOR, YYLIMIT - YYCURSOR ); + + S_FREE( domain ); + return uri; + } +yy227: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -2233,256 +2250,143 @@ yy225: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy226; - default: goto yy195; - } -yy226: yych = *++YYCURSOR; - switch(yych){ - case '/': goto yy220; - default: goto yy195; - } -yy227: yych = *++YYCURSOR; - switch(yych){ - case 'p': goto yy228; - default: goto yy204; + case '9': goto yy228; + default: goto yy200; } yy228: yych = *++YYCURSOR; switch(yych){ - case ',': goto yy207; - case '.': goto yy208; - case '/': goto yy209; - case 'r': goto yy229; - default: goto yy204; + case '-': goto yy229; + case '/': goto yy225; + default: goto yy200; } yy229: yych = *++YYCURSOR; switch(yych){ - case ',': goto yy207; - case '.': goto yy208; - case '/': goto yy209; - case 'i': goto yy230; - default: goto yy204; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy230; + default: goto yy200; } yy230: yych = *++YYCURSOR; switch(yych){ - case ',': goto yy207; - case '.': goto yy208; - case '/': goto yy209; - case 'v': goto yy231; - default: goto yy204; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy231; + default: goto yy200; } yy231: yych = *++YYCURSOR; switch(yych){ - case ',': goto yy207; - case '.': goto yy208; - case '/': goto yy209; - case 'a': goto yy232; - default: goto yy204; + case '/': goto yy225; + default: goto yy200; } yy232: yych = *++YYCURSOR; switch(yych){ - case ',': goto yy207; - case '.': goto yy208; - case '/': goto yy209; - case 't': goto yy233; - default: goto yy204; + case 'p': goto yy233; + default: goto yy209; } yy233: yych = *++YYCURSOR; switch(yych){ - case ',': goto yy207; - case '.': goto yy208; - case '/': goto yy209; - case 'e': goto yy234; - default: goto yy204; + case ',': goto yy212; + case '.': goto yy213; + case '/': goto yy214; + case 'r': goto yy234; + default: goto yy209; } yy234: yych = *++YYCURSOR; switch(yych){ - case ',': goto yy207; - case '.': goto yy208; - case '/': goto yy209; - case ':': goto yy235; - default: goto yy204; + case ',': goto yy212; + case '.': goto yy213; + case '/': goto yy214; + case 'i': goto yy235; + default: goto yy209; } yy235: yych = *++YYCURSOR; -yy236: -#line 142 - { return type_id; } + switch(yych){ + case ',': goto yy212; + case '.': goto yy213; + case '/': goto yy214; + case 'v': goto yy236; + default: goto yy209; + } +yy236: yych = *++YYCURSOR; + switch(yych){ + case ',': goto yy212; + case '.': goto yy213; + case '/': goto yy214; + case 'a': goto yy237; + default: goto yy209; + } yy237: yych = *++YYCURSOR; switch(yych){ - case ',': goto yy207; - case '.': goto yy208; - case '/': goto yy209; - case 'g': goto yy238; - default: goto yy204; + case ',': goto yy212; + case '.': goto yy213; + case '/': goto yy214; + case 't': goto yy238; + default: goto yy209; } yy238: yych = *++YYCURSOR; switch(yych){ - case ',': goto yy207; - case '.': goto yy208; - case '/': goto yy209; - case ':': goto yy239; - default: goto yy204; + case ',': goto yy212; + case '.': goto yy213; + case '/': goto yy214; + case 'e': goto yy239; + default: goto yy209; } yy239: yych = *++YYCURSOR; switch(yych){ - case ',': - case '-': - case '.': goto yy195; - default: goto yy241; + case ',': goto yy212; + case '.': goto yy213; + case '/': goto yy214; + case ':': goto yy240; + default: goto yy209; } -yy240: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy241: switch(yych){ - case ',': goto yy244; - case '-': goto yy242; - case '.': goto yy245; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': case '_': case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': goto yy240; - default: goto yy195; +yy240: yych = *++YYCURSOR; +yy241: +#line 145 + { return type_id; } +yy242: yych = *++YYCURSOR; + switch(yych){ + case ',': goto yy212; + case '.': goto yy213; + case '/': goto yy214; + case 'g': goto yy243; + default: goto yy209; } -yy242: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy243: switch(yych){ - case '-': goto yy242; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': case '_': case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': goto yy240; - default: goto yy195; +yy243: yych = *++YYCURSOR; + switch(yych){ + case ',': goto yy212; + case '.': goto yy213; + case '/': goto yy214; + case ':': goto yy244; + default: goto yy209; } yy244: yych = *++YYCURSOR; switch(yych){ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy250; - default: goto yy195; + case ',': + case '-': + case '.': goto yy200; + default: goto yy246; } yy245: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; - switch(yych){ +yy246: switch(yych){ + case ',': goto yy249; + case '-': goto yy247; + case '.': goto yy250; case '0': case '1': case '2': @@ -2542,83 +2446,14 @@ yy245: ++YYCURSOR; case 'w': case 'x': case 'y': - case 'z': goto yy246; - default: goto yy195; + case 'z': goto yy245; + default: goto yy200; } -yy246: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; -yy247: switch(yych){ - case ',': goto yy244; - case '-': goto yy248; - case '.': goto yy245; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': case '_': case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': goto yy246; - default: goto yy195; - } -yy248: ++YYCURSOR; +yy247: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy249: switch(yych){ - case '-': goto yy248; +yy248: switch(yych){ + case '-': goto yy247; case '0': case '1': case '2': @@ -2678,10 +2513,10 @@ yy249: switch(yych){ case 'w': case 'x': case 'y': - case 'z': goto yy246; - default: goto yy195; + case 'z': goto yy245; + default: goto yy200; } -yy250: yych = *++YYCURSOR; +yy249: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -2692,10 +2527,12 @@ yy250: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy251; - default: goto yy195; + case '9': goto yy255; + default: goto yy200; } -yy251: yych = *++YYCURSOR; +yy250: ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; switch(yych){ case '0': case '1': @@ -2706,10 +2543,196 @@ yy251: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy252; - default: goto yy195; + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy251; + default: goto yy200; } -yy252: yych = *++YYCURSOR; +yy251: ++YYCURSOR; + if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; +yy252: switch(yych){ + case ',': goto yy249; + case '-': goto yy253; + case '.': goto yy250; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy251; + default: goto yy200; + } +yy253: ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; +yy254: switch(yych){ + case '-': goto yy253; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': case '_': case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy251; + default: goto yy200; + } +yy255: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -2720,16 +2743,10 @@ yy252: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy253; - default: goto yy195; + case '9': goto yy256; + default: goto yy200; } -yy253: yych = *++YYCURSOR; - switch(yych){ - case '-': goto yy254; - case ':': goto yy255; - default: goto yy195; - } -yy254: yych = *++YYCURSOR; +yy256: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -2741,12 +2758,8 @@ yy254: yych = *++YYCURSOR; case '7': case '8': case '9': goto yy257; - default: goto yy195; + default: goto yy200; } -yy255: yych = *++YYCURSOR; -yy256: -#line 140 - { return type_id; } yy257: yych = *++YYCURSOR; switch(yych){ case '0': @@ -2759,13 +2772,13 @@ yy257: yych = *++YYCURSOR; case '7': case '8': case '9': goto yy258; - default: goto yy195; + default: goto yy200; } yy258: yych = *++YYCURSOR; switch(yych){ case '-': goto yy259; - case ':': goto yy255; - default: goto yy195; + case ':': goto yy260; + default: goto yy200; } yy259: yych = *++YYCURSOR; switch(yych){ @@ -2778,10 +2791,14 @@ yy259: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy260; - default: goto yy195; + case '9': goto yy262; + default: goto yy200; } yy260: yych = *++YYCURSOR; +yy261: +#line 143 + { return type_id; } +yy262: yych = *++YYCURSOR; switch(yych){ case '0': case '1': @@ -2792,16 +2809,50 @@ yy260: yych = *++YYCURSOR; case '6': case '7': case '8': - case '9': goto yy261; - default: goto yy195; + case '9': goto yy263; + default: goto yy200; } -yy261: yych = *++YYCURSOR; +yy263: yych = *++YYCURSOR; switch(yych){ - case ':': goto yy255; - default: goto yy195; + case '-': goto yy264; + case ':': goto yy260; + default: goto yy200; + } +yy264: yych = *++YYCURSOR; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy265; + default: goto yy200; + } +yy265: yych = *++YYCURSOR; + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy266; + default: goto yy200; + } +yy266: yych = *++YYCURSOR; + switch(yych){ + case ':': goto yy260; + default: goto yy200; } } -#line 172 +#line 175 } diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c index 877b18d303..9bce253602 100644 --- a/ext/syck/rubyext.c +++ b/ext/syck/rubyext.c @@ -412,7 +412,7 @@ yaml_org_handler( n, ref ) { case syck_str_kind: transferred = 1; - if ( type_id == NULL || strcmp( type_id, "str" ) == 0 ) + if ( type_id == NULL ) { obj = rb_str_new( n->data.str->ptr, n->data.str->len ); } @@ -438,12 +438,39 @@ yaml_org_handler( n, ref ) } else if ( strcmp( type_id, "int#hex" ) == 0 ) { + syck_str_blow_away_commas( n ); obj = rb_cstr2inum( n->data.str->ptr, 16 ); } else if ( strcmp( type_id, "int#oct" ) == 0 ) { + syck_str_blow_away_commas( n ); obj = rb_cstr2inum( n->data.str->ptr, 8 ); } + else if ( strcmp( type_id, "int#base60" ) == 0 ) + { + char *ptr, *end; + long sixty = 1; + long total = 0; + syck_str_blow_away_commas( n ); + ptr = n->data.str->ptr; + end = n->data.str->ptr + n->data.str->len; + while ( end > ptr ) + { + long bnum = 0; + char *colon = end - 1; + while ( colon >= ptr && *colon != ':' ) + { + colon--; + } + if ( *colon == ':' ) *colon = '\0'; + + bnum = strtol( colon + 1, NULL, 10 ); + total += bnum * sixty; + sixty *= 60; + end = colon; + } + obj = INT2FIX(total); + } else if ( strncmp( type_id, "int", 3 ) == 0 ) { syck_str_blow_away_commas( n ); @@ -495,27 +522,30 @@ yaml_org_handler( n, ref ) while ( !ISDIGIT( *ptr ) ) ptr++; day = INT2FIX(strtol(ptr, NULL, 10)); - if ( !cDate ) { - /* - * Load Date module - */ - rb_require( "date" ); - cDate = rb_const_get( rb_cObject, rb_intern("Date") ); - } - obj = rb_funcall( cDate, s_new, 3, year, mon, day ); } else if ( strncmp( type_id, "timestamp", 9 ) == 0 ) { obj = rb_syck_mktime( n->data.str->ptr ); } - else if ( strncmp( type_id, "merge", 5 ) == 0 ) + else if ( strncmp( type_id, "merge", 5 ) == 0 ) + { + obj = rb_funcall( cMergeKey, s_new, 0 ); + } + else if ( strncmp( type_id, "default", 7 ) == 0 ) + { + obj = rb_funcall( cDefaultKey, s_new, 0 ); + } + else if ( strncmp( n->data.str->ptr, ":", 1 ) == 0 ) { - obj = rb_funcall( cMergeKey, s_new, 0 ); + char *tmp; + tmp = syck_strndup( n->data.str->ptr + 1, n->data.str->len - 1 ); + obj = ID2SYM( rb_intern( tmp ) ); + free( tmp ); } - else if ( strncmp( type_id, "default", 7 ) == 0 ) + else if ( strcmp( type_id, "str" ) == 0 ) { - obj = rb_funcall( cDefaultKey, s_new, 0 ); + obj = rb_str_new( n->data.str->ptr, n->data.str->len ); } else { @@ -544,46 +574,46 @@ yaml_org_handler( n, ref ) obj = rb_hash_new(); for ( i = 0; i < n->data.pairs->idx; i++ ) { - VALUE k = syck_map_read( n, map_key, i ); - VALUE v = syck_map_read( n, map_value, i ); - int skip_aset = 0; + VALUE k = syck_map_read( n, map_key, i ); + VALUE v = syck_map_read( n, map_value, i ); + int skip_aset = 0; - /* - * Handle merge keys - */ - if ( rb_obj_is_kind_of( k, cMergeKey ) ) - { - if ( rb_obj_is_kind_of( v, rb_cHash ) ) - { - VALUE dup = rb_funcall( v, s_dup, 0 ); - rb_funcall( dup, s_update, 1, obj ); - obj = dup; - skip_aset = 1; - } - else if ( rb_obj_is_kind_of( v, rb_cArray ) ) - { - VALUE end = rb_ary_pop( v ); - if ( rb_obj_is_kind_of( end, rb_cHash ) ) - { - VALUE dup = rb_funcall( end, s_dup, 0 ); - v = rb_ary_reverse( v ); - rb_ary_push( v, obj ); - rb_iterate( rb_each, v, syck_merge_i, dup ); - obj = dup; - skip_aset = 1; - } - } - } + /* + * Handle merge keys + */ + if ( rb_obj_is_kind_of( k, cMergeKey ) ) + { + if ( rb_obj_is_kind_of( v, rb_cHash ) ) + { + VALUE dup = rb_funcall( v, s_dup, 0 ); + rb_funcall( dup, s_update, 1, obj ); + obj = dup; + skip_aset = 1; + } + else if ( rb_obj_is_kind_of( v, rb_cArray ) ) + { + VALUE end = rb_ary_pop( v ); + if ( rb_obj_is_kind_of( end, rb_cHash ) ) + { + VALUE dup = rb_funcall( end, s_dup, 0 ); + v = rb_ary_reverse( v ); + rb_ary_push( v, obj ); + rb_iterate( rb_each, v, syck_merge_i, dup ); + obj = dup; + skip_aset = 1; + } + } + } else if ( rb_obj_is_kind_of( k, cDefaultKey ) ) { rb_funcall( obj, s_default_set, 1, v ); skip_aset = 1; } - if ( ! skip_aset ) - { - rb_hash_aset( obj, k, v ); - } + if ( ! skip_aset ) + { + rb_hash_aset( obj, k, v ); + } } break; } diff --git a/test/yaml/test_yaml.rb b/test/yaml/test_yaml.rb index 6ddde2065c..674ecf8888 100644 --- a/test/yaml/test_yaml.rb +++ b/test/yaml/test_yaml.rb @@ -442,6 +442,14 @@ octal: 014 hexadecimal: 0xC EOY ) + assert_parse_only( + { 'canonical' => 685230, 'decimal' => 685230, 'octal' => '02472256'.oct, 'hexadecimal' => '0x0A74AE'.hex, 'sexagesimal' => 685230 }, <