summaryrefslogtreecommitdiff
path: root/ext/syck/syck.c
diff options
context:
space:
mode:
authorwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-17 16:55:54 +0000
committerwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-17 16:55:54 +0000
commitae28f1b6b3b22afb529f599385d1f2af258624e9 (patch)
tree718fc605c85aa7d3c2b05fbfbc46c41320b74db9 /ext/syck/syck.c
parent77e941269fcddc8f5af6e553592fc3ef0132727c (diff)
* ext/syck/gram.c: added grammar for certain empty sequence entries.
* ext/syck/handler.c, ext/syck/syck.c, ext/syck/syck.h: track bad anchors. * ext/syck/token.c: added pause token, tag possible circular references. * lib/yaml/rubytypes.rb: parsing YMD time as Date instance. * ext/syck/rubyext.c: ditto. DomainType, PrivateType, BadAlias classes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/syck/syck.c')
-rw-r--r--ext/syck/syck.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/syck/syck.c b/ext/syck/syck.c
index 18623ffb266..d227a36305b 100644
--- a/ext/syck/syck.c
+++ b/ext/syck/syck.c
@@ -170,6 +170,7 @@ syck_new_parser()
p->io.str = NULL;
p->syms = NULL;
p->anchors = NULL;
+ p->bad_anchors = NULL;
p->implicit_typing = 1;
p->taguri_expansion = 0;
p->bufsize = SYCK_BUFFERSIZE;
@@ -219,7 +220,7 @@ syck_st_free( SyckParser *p )
}
//
- // Free the anchor table
+ // Free the anchor tables
//
if ( p->anchors != NULL )
{
@@ -227,6 +228,13 @@ syck_st_free( SyckParser *p )
st_free_table( p->anchors );
p->anchors = NULL;
}
+
+ if ( p->bad_anchors != NULL )
+ {
+ st_foreach( p->bad_anchors, syck_st_free_nodes, 0 );
+ st_free_table( p->bad_anchors );
+ p->bad_anchors = NULL;
+ }
}
void
@@ -278,6 +286,13 @@ syck_parser_error_handler( SyckParser *p, SyckErrorHandler hdlr )
}
void
+syck_parser_bad_anchor_handler( SyckParser *p, SyckBadAnchorHandler hdlr )
+{
+ ASSERT( p != NULL );
+ p->bad_anchor_handler = hdlr;
+}
+
+void
syck_parser_file( SyckParser *p, FILE *fp, SyckIoFileRead read )
{
ASSERT( p != NULL );