diff options
author | Thomas White <taw@bitwiz.me.uk> | 2020-01-12 18:15:27 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2020-01-12 18:26:37 +0100 |
commit | 07fb4674904bac673ddbb5d6ce4afbe959c4dcd3 (patch) | |
tree | 4f8742bf77387d66b198044ea94ec6c209d729eb /libstorycode/storycode.c | |
parent | d4071cb956c80143d188813d8064333946c38ecf (diff) |
Make the lexer and parser re-entrant
Diffstat (limited to 'libstorycode/storycode.c')
-rw-r--r-- | libstorycode/storycode.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libstorycode/storycode.c b/libstorycode/storycode.c index 983ae02..89c0440 100644 --- a/libstorycode/storycode.c +++ b/libstorycode/storycode.c @@ -46,14 +46,15 @@ Narrative *storycode_parse_presentation(const char *sc) { YY_BUFFER_STATE b; Narrative *n; + yyscan_t scanner; - //BEGIN(0); - b = sc_scan_string(sc); - scdebug = 1; + yylex_init(&scanner); + b = yy_scan_string(sc, scanner); + yydebug = 0; n = narrative_new(); - scparse(n); - sc_delete_buffer(b); - //narrative_debug(n); + yyparse(n, scanner); + yy_delete_buffer(b, scanner); + yylex_destroy(scanner); return n; } |