mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/syck/token.c: directives choked on a period.
* ext/syck/gram.y: anchors work above a collection. [ruby-core:1071] * ext/syck/handler.c, ext/syck/syck.c: ensure a fresh strtable between parser iterations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
45c7ea552d
commit
017d4ff10a
7 changed files with 326 additions and 193 deletions
|
@ -31,6 +31,10 @@ SyckNode *
|
|||
syck_hdlr_add_anchor( SyckParser *p, char *a, SyckNode *n )
|
||||
{
|
||||
n->anchor = a;
|
||||
if ( p->anchors == NULL )
|
||||
{
|
||||
p->anchors = st_init_strtable();
|
||||
}
|
||||
st_insert( p->anchors, (st_data_t)a, (st_data_t)n );
|
||||
return n;
|
||||
}
|
||||
|
@ -40,9 +44,12 @@ syck_hdlr_add_alias( SyckParser *p, char *a )
|
|||
{
|
||||
SyckNode *n;
|
||||
|
||||
if ( st_lookup( p->anchors, (st_data_t)a, (st_data_t *)&n ) )
|
||||
if ( p->anchors != NULL )
|
||||
{
|
||||
return n;
|
||||
if ( st_lookup( p->anchors, (st_data_t)a, (st_data_t *)&n ) )
|
||||
{
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue