summaryrefslogtreecommitdiff
path: root/ext/syck/node.c
diff options
context:
space:
mode:
authorwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-14 20:01:09 +0000
committerwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-14 20:01:09 +0000
commitf5a6a36471123985aa452b6c03d1667c4e447d29 (patch)
tree8443bb4cdace2625febeacf6e9dccf45952742d7 /ext/syck/node.c
parentcf13323ff4bd0214fed144907637bd149f283989 (diff)
* ext/syck/gram.c: sequence-in-map shortcut, transfer methods on
sequence-in-sequence, memory leak in mapping merge. [0.28] * ext/syck/syck.c: memory leak in domain anchoring. [0.28] * lib/yaml/rubytypes.rb, lib/yaml/types.rb: eliminated 1.6.x code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/syck/node.c')
-rw-r--r--ext/syck/node.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/syck/node.c b/ext/syck/node.c
index 182ffee98b..26a9bdd0a5 100644
--- a/ext/syck/node.c
+++ b/ext/syck/node.c
@@ -22,6 +22,7 @@ syck_alloc_node( enum syck_kind_tag type )
s->id = 0;
s->type_id = NULL;
s->anchor = NULL;
+ s->shortcut = NULL;
return s;
}
@@ -207,6 +208,24 @@ syck_map_count( SyckNode *map )
return map->data.pairs->idx;
}
+void
+syck_map_assign( SyckNode *map, enum map_part p, long idx, SYMID id )
+{
+ struct SyckMap *m;
+
+ ASSERT( map != NULL );
+ m = map->data.pairs;
+ ASSERT( m != NULL );
+ if ( p == map_key )
+ {
+ m->keys[idx] = id;
+ }
+ else
+ {
+ m->values[idx] = id;
+ }
+}
+
SYMID
syck_map_read( SyckNode *map, enum map_part p, long idx )
{