diff options
author | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-16 16:09:41 +0000 |
---|---|---|
committer | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-16 16:09:41 +0000 |
commit | b02b4bb04831671c77dbd55eaf7e77e1629c03b5 (patch) | |
tree | 8311ecba8628f181bc0ce9e4d91dd34298a62b49 /ext/syck/node.c | |
parent | c16bdcc5e1c10fa873e35c7e0b184f7f99340786 (diff) |
* lib/yaml.rb: removed fallback to pure Ruby parser.
* lib/yaml/baseemitter.rb (indent_text): was forcing a mod value
of zero at times, which kept some blocks from getting indentation.
* lib/yaml/baseemitter.rb (node_text): rewriting folded scalars.
* ext/syck/syck.h: reports style of scalars now, be they plain, block
single-, or double-quoted.
* ext/syck/syck.c: ditto.
* ext/syck/gram.c: ditto.
* ext/syck/node.c: ditto.
* ext/syck/token.c: ditto.
* ext/syck/rubyext.c (yaml_org_handler): symbols loaded only
if scalar style is plain.
* ext/syck/rubyext.c (yaml_org_handler): some empty strings were
loaded as symbols.
* test/yaml/test_yaml.rb (test_perl_regexp): updated test to
match new regexp serialization.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/syck/node.c')
-rw-r--r-- | ext/syck/node.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/syck/node.c b/ext/syck/node.c index 86c4086bc7..500ede2a4c 100644 --- a/ext/syck/node.c +++ b/ext/syck/node.c @@ -83,6 +83,7 @@ syck_alloc_str() s = S_ALLOC( struct SyckStr ); s->len = 0; s->ptr = NULL; + s->style = scalar_none; n = syck_alloc_node( syck_str_kind ); n->data.str = s; @@ -91,19 +92,20 @@ syck_alloc_str() } SyckNode * -syck_new_str( char *str ) +syck_new_str( char *str, enum scalar_style style ) { - return syck_new_str2( str, strlen( str ) ); + return syck_new_str2( str, strlen( str ), style ); } SyckNode * -syck_new_str2( char *str, long len ) +syck_new_str2( char *str, long len, enum scalar_style style ) { SyckNode *n; n = syck_alloc_str(); n->data.str->ptr = S_ALLOC_N( char, len + 1 ); n->data.str->len = len; + n->data.str->style = style; memcpy( n->data.str->ptr, str, len ); n->data.str->ptr[len] = '\0'; |