# New Ticket Created by Bernhard Schmalhofer # Please include the string: [perl #38255] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=38255 >
Parrot bindings for libsyck have been started, but never really completed. Some notes on YAML::Parser::Syck are at http://yaml.kwiki.org/index.cgi?ParrotDev TODO: Bring the needed patches to libsyck to some repository, or bundle them with Parrot. The latest, November 2004, patches to the libsyck source are attached. Anybody who wants to delve into that, please feel free to take over. CU, Bernhard
? Makefile ? Makefile.in ? aclocal.m4 ? autom4te.cache ? config.h ? config.h.in ? config.log ? config.status ? configure ? diff.out ? libtool ? stamp-h1 ? config/depcomp ? config/install-sh ? config/missing ? lib/.deps ? lib/.libs ? lib/Makefile ? lib/Makefile.in ? lib/bytecode.lo ? lib/emitter.lo ? lib/gram.c ? lib/gram.h ? lib/gram.lo ? lib/gram.output ? lib/handler.lo ? lib/implicit.lo ? lib/libsyck.la ? lib/node.lo ? lib/syck.lo ? lib/syck_st.lo ? lib/token.lo ? lib/yaml2byte.lo ? tests/.deps ? tests/.libs ? tests/Makefile ? tests/Makefile.in ? tests/test-basic ? tests/test-emit ? tests/test-parse Index: configure.in =================================================================== RCS file: /var/cvs/syck/syck/configure.in,v retrieving revision 1.20 diff -u -u -r1.20 configure.in --- configure.in 2 Aug 2004 17:32:34 -0000 1.20 +++ configure.in 14 Nov 2004 12:51:27 -0000 @@ -10,10 +10,12 @@ AC_PROG_CC_STDC AC_PROG_INSTALL AC_PROG_LN_S -AC_PROG_RANLIB +#AC_PROG_RANLIB AC_PROG_MAKE_SET AC_PROG_AWK AC_PROG_YACC +# Added by bernhard 2004-08-18 +AC_PROG_LIBTOOL AM_PROG_LEX # Checks for libraries. Index: ext/ruby/ext/syck/rubyext.c =================================================================== RCS file: /var/cvs/syck/syck/ext/ruby/ext/syck/rubyext.c,v retrieving revision 1.33 diff -u -u -r1.33 rubyext.c --- ext/ruby/ext/syck/rubyext.c 18 Aug 2004 17:49:47 -0000 1.33 +++ ext/ruby/ext/syck/rubyext.c 14 Nov 2004 12:51:30 -0000 @@ -673,12 +673,11 @@ * - Converts data into native Ruby types */ SYMID -rb_syck_load_handler(p, n) - SyckParser *p; +rb_syck_load_handler(bonus, n) + struct parser_xtra *bonus; SyckNode *n; { VALUE obj = Qnil; - struct parser_xtra *bonus; /* * Attempt common transfers @@ -699,7 +698,6 @@ obj = n->id; } - bonus = (struct parser_xtra *)p->bonus; if ( bonus->taint) OBJ_TAINT( obj ); if ( bonus->proc != 0 ) rb_funcall(bonus->proc, s_call, 1, obj); Index: lib/Makefile.am =================================================================== RCS file: /var/cvs/syck/syck/lib/Makefile.am,v retrieving revision 1.20 diff -u -u -r1.20 Makefile.am --- lib/Makefile.am 18 Aug 2004 17:49:47 -0000 1.20 +++ lib/Makefile.am 14 Nov 2004 12:51:31 -0000 @@ -4,10 +4,12 @@ AM_YFLAGS = -d -t -v -p syck -lib_LIBRARIES = libsyck.a +#lib_LIBRARIES = libsyck.a +lib_LTLIBRARIES = libsyck.la include_HEADERS = syck.h syck_st.h -libsyck_a_SOURCES = \ +# libsyck_a_SOURCES = +libsyck_la_SOURCES = \ emitter.c \ handler.c \ node.c \ Index: lib/handler.c =================================================================== RCS file: /var/cvs/syck/syck/lib/handler.c,v retrieving revision 1.25 diff -u -u -r1.25 handler.c --- lib/handler.c 13 Oct 2003 01:54:00 -0000 1.25 +++ lib/handler.c 14 Nov 2004 12:51:31 -0000 @@ -16,7 +16,7 @@ if ( ! n->id ) { - n->id = (p->handler)( p, n ); + n->id = (p->handler)( p->bonus, n ); } id = n->id; @@ -39,7 +39,7 @@ if ( n->kind != syck_str_kind ) { n->id = bad->id; - (p->handler)( p, n ); + (p->handler)( p->bonus, n ); } } } @@ -83,7 +83,7 @@ } if ( ! st_lookup( p->bad_anchors, (st_data_t)a, (st_data_t *)&n ) ) { - n = (p->bad_anchor_handler)( p, a ); + n = (p->bad_anchor_handler)( p->bonus, a ); st_insert( p->bad_anchors, (st_data_t)a, (st_data_t)n ); } } @@ -92,7 +92,7 @@ if ( n == NULL ) { - n = (p->bad_anchor_handler)( p, a ); + n = (p->bad_anchor_handler)( p->bonus, a ); } if ( n->anchor ) Index: lib/syck.c =================================================================== RCS file: /var/cvs/syck/syck/lib/syck.c,v retrieving revision 1.52 diff -u -u -r1.52 syck.c --- lib/syck.c 2 Aug 2004 17:32:34 -0000 1.52 +++ lib/syck.c 14 Nov 2004 12:51:32 -0000 @@ -260,6 +260,13 @@ } void +syck_parser_bonus( SyckParser *p, void * bonus ) +{ + ASSERT( p != NULL ); + p->bonus = bonus; +} + +void syck_parser_implicit_typing( SyckParser *p, int flag ) { p->implicit_typing = ( flag == 0 ? 0 : 1 ); Index: lib/syck.h =================================================================== RCS file: /var/cvs/syck/syck/lib/syck.h,v retrieving revision 1.62 diff -u -u -r1.62 syck.h --- lib/syck.h 2 Aug 2004 17:32:34 -0000 1.62 +++ lib/syck.h 14 Nov 2004 12:51:33 -0000 @@ -355,6 +355,7 @@ void syck_parser_implicit_typing( SyckParser *, int ); void syck_parser_taguri_expansion( SyckParser *, int ); void syck_parser_handler( SyckParser *, SyckNodeHandler ); +void syck_parser_bonus( SyckParser *, void * ); void syck_parser_error_handler( SyckParser *, SyckErrorHandler ); void syck_parser_bad_anchor_handler( SyckParser *, SyckBadAnchorHandler ); void syck_parser_file( SyckParser *, FILE *, SyckIoFileRead );
Index: README =================================================================== RCS file: /var/cvs/syck/syck/README,v retrieving revision 1.21 diff -u -u -r1.21 README --- README 2 Aug 2004 17:32:34 -0000 1.21 +++ README 8 Sep 2004 20:52:48 -0000 @@ -76,9 +76,15 @@ YAML_load( VALUE str ) { SyckParser* parser; + SYMID oid; + parser = syck_new_parser(); syck_parser_handler( parser, YAML_handler ); - return syck_parse( parser, str ); + syck_parser_str_auto(parser, str, NULL); + oid = syck_parse( parser ); + syck_free_parser(parser); + + return oid; } static VALUE