Module | YAML::Syck
In: | syck/rubyext.c

### Methods

compile

### Classes and Modules

Class YAML::Syck::BadAlias
Class YAML::Syck::DefaultKey
Class YAML::Syck::Emitter
Class YAML::Syck::Map
Class YAML::Syck::MergeKey
Class YAML::Syck::Node
Class YAML::Syck::Out
Class YAML::Syck::Parser
Class YAML::Syck::Resolver
Class YAML::Syck::Scalar
Class YAML::Syck::Seq

### Public Instance methods

compile(p1)

Convert YAML to bytecode

[Source]

    /*
     * Convert YAML to bytecode
     */
    VALUE
    rb_syck_compile(self, port)
        VALUE self, port;
    {
        SYMID oid;
        int taint;
        char *ret;
        VALUE bc;
        bytestring_t *sav;

        SyckParser *parser = syck_new_parser();
        taint = syck_parser_assign_io(parser, port);
        syck_parser_handler( parser, syck_yaml2byte_handler );
        syck_parser_error_handler( parser, NULL );
        syck_parser_implicit_typing( parser, 0 );
        syck_parser_taguri_expansion( parser, 0 );
        oid = syck_parse( parser );
        syck_lookup_sym( parser, oid, (char **)&sav );

        ret = S_ALLOC_N( char, strlen( sav->buffer ) + 3 );
        ret[0] = '\0';
        strcat( ret, "D\n" );
        strcat( ret, sav->buffer );

        syck_free_parser( parser );

        bc = rb_str_new2( ret );
        if ( taint )      OBJ_TAINT( bc );
        return bc;
    }

[Validate]