https://github.com/indeyets/syck/issues/10 diff --git a/lib/gram.y b/lib/gram.y index c32889a..d47add9 100644 --- a/lib/gram.y +++ b/lib/gram.y @@ -9,6 +9,8 @@ %start doc %pure-parser +%parse-param {void* parser} +%lex-param {void* parser} %{ @@ -24,9 +26,6 @@ void apply_seq_in_map( SyckParser *parser, SyckNode *n ); -#define YYPARSE_PARAM parser -#define YYLEX_PARAM parser - #define NULL_NODE(parser, node) \ SyckNode *node = syck_new_str( "", scalar_plain ); \ if ( ((SyckParser *)parser)->taguri_expansion == 1 ) \ diff --git a/lib/syck.h b/lib/syck.h index 6282129..fedce0e 100644 --- a/lib/syck.h +++ b/lib/syck.h @@ -467,7 +467,7 @@ struct _syck_emitter_node { /* * Lexer prototypes */ -void syckerror( const char * ); +void syckerror( void *, const char * ); int syckparse( void * ); #if defined(__cplusplus) diff --git a/lib/token.c b/lib/token.c index 18f464a..8fbe7ab 100644 --- a/lib/token.c +++ b/lib/token.c @@ -200,7 +200,7 @@ { \ if ( *indent == '\t' ) \ { \ - syckerror("TAB found in your indentation, please remove"); \ + syckerror(0, "TAB found in your indentation, please remove"); \ return 0; \ } \ else if ( is_newline( indent++ ) ) \ @@ -266,11 +266,11 @@ return sycklex_yaml_utf8( sycklval, parser ); case syck_yaml_utf16: - syckerror( "UTF-16 is not currently supported in Syck.\nPlease contribute code to help this happen!" ); + syckerror(0, "UTF-16 is not currently supported in Syck.\nPlease contribute code to help this happen!" ); break; case syck_yaml_utf32: - syckerror( "UTF-32 is not currently supported in Syck.\nPlease contribute code to help this happen!" ); + syckerror(0, "UTF-32 is not currently supported in Syck.\nPlease contribute code to help this happen!" ); break; case syck_bytecode_utf8: @@ -2768,7 +2768,7 @@ } void -syckerror( const char *msg ) +syckerror( void * parser, const char *msg ) { if ( syck_parser_ptr->error_handler == NULL ) syck_parser_ptr->error_handler = syck_default_error_handler;