diff options
| author | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-14 23:15:19 +0000 |
|---|---|---|
| committer | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-14 23:15:19 +0000 |
| commit | 4688d51e1d106bd910c19ca43c3e893ca00f9dbe (patch) | |
| tree | 8e4ffb887b591097de3f8f5b080276bb62f7648c /ext/syck/syck.c | |
| parent | 8e4c4619515827f38a2acfd822b97848091a8f4e (diff) | |
| download | ruby-4688d51e1d106bd910c19ca43c3e893ca00f9dbe.tar.gz ruby-4688d51e1d106bd910c19ca43c3e893ca00f9dbe.tar.xz ruby-4688d51e1d106bd910c19ca43c3e893ca00f9dbe.zip | |
* ext/syck/bytecode.c: Checkin of YAML bytecode support.
* ext/syck/gram.c: Ditto.
* ext/syck/syck.c: Ditto.
* ext/syck/token.c: Ditto.
* ext/syck/handler.c: Ditto.
* ext/syck/handler.c: Now using 'tag' rather than 'taguri' in type URIs.
* ext/syck/rubyext.c: Ditto (on both counts).
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/syck/syck.c')
| -rw-r--r-- | ext/syck/syck.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/syck/syck.c b/ext/syck/syck.c index 707225762..9f2f90038 100644 --- a/ext/syck/syck.c +++ b/ext/syck/syck.c @@ -9,8 +9,8 @@ #include <stdio.h> #include <string.h> -#include "syck.h" #include "ruby.h" +#include "syck.h" void syck_parser_pop_level( SyckParser * ); @@ -109,6 +109,7 @@ syck_parser_reset_levels( SyckParser *p ) { p->lvl_idx = 1; p->levels[0].spaces = -1; + p->levels[0].ncount = 0; p->levels[0].domain = syck_strndup( "", 0 ); } p->levels[0].status = syck_lvl_header; @@ -159,6 +160,7 @@ syck_new_parser() p = S_ALLOC( SyckParser ); p->lvl_capa = ALLOC_CT; p->levels = S_ALLOC_N( SyckLevel, p->lvl_capa ); + p->input_type = syck_yaml_utf8; p->io_type = syck_io_str; p->io.str = NULL; p->syms = NULL; @@ -283,6 +285,13 @@ syck_parser_bad_anchor_handler( SyckParser *p, SyckBadAnchorHandler hdlr ) } void +syck_parser_set_input_type( SyckParser *p, enum syck_parser_input input_type ) +{ + ASSERT( p != NULL ); + p->input_type = input_type; +} + +void syck_parser_file( SyckParser *p, FILE *fp, SyckIoFileRead read ) { ASSERT( p != NULL ); @@ -358,6 +367,7 @@ syck_parser_add_level( SyckParser *p, int len, enum syck_level_status status ) ASSERT( len > p->levels[p->lvl_idx-1].spaces ); p->levels[p->lvl_idx].spaces = len; + p->levels[p->lvl_idx].ncount = 0; p->levels[p->lvl_idx].domain = syck_strndup( p->levels[p->lvl_idx-1].domain, strlen( p->levels[p->lvl_idx-1].domain ) ); p->levels[p->lvl_idx].status = status; p->lvl_idx += 1; |
