diff options
author | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-15 03:11:28 +0000 |
---|---|---|
committer | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-15 03:11:28 +0000 |
commit | c474911e5b78749c5a85db39256240db5fb9e3be (patch) | |
tree | f333f1c306d07933ceb2f4098b8aefde5d34d29e /ext/syck/syck.h | |
parent | 094290e68fd4dfed851e8f7254d60a1301fe97e2 (diff) | |
download | ruby-c474911e5b78749c5a85db39256240db5fb9e3be.tar.gz |
* lib/yaml.rb: removed fallback to pure Ruby parser.
* 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.
* 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/trunk@6315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/syck/syck.h')
-rw-r--r-- | ext/syck/syck.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ext/syck/syck.h b/ext/syck/syck.h index 60c06c0cb8..51604b4a0c 100644 --- a/ext/syck/syck.h +++ b/ext/syck/syck.h @@ -84,6 +84,14 @@ enum map_part { map_value }; +enum scalar_style { + scalar_none, + scalar_plain, + scalar_1quote, + scalar_2quote, + scalar_block +}; + /* * Node metadata struct */ @@ -112,6 +120,7 @@ struct _syck_node { } *list; /* Storage for string data */ struct SyckStr { + enum scalar_style style; char *ptr; long len; } *str; @@ -367,8 +376,8 @@ SyckNode *syck_alloc_seq(); SyckNode *syck_alloc_str(); void syck_free_node( SyckNode * ); void syck_free_members( SyckNode * ); -SyckNode *syck_new_str( char * ); -SyckNode *syck_new_str2( char *, long ); +SyckNode *syck_new_str( char *, enum scalar_style ); +SyckNode *syck_new_str2( char *, long, enum scalar_style ); void syck_str_blow_away_commas( SyckNode * ); char *syck_str_read( SyckNode * ); SyckNode *syck_new_map( SYMID, SYMID ); |