From 0667ba5a597f5b94c68f414909453648eab2835c Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 2 Oct 2019 09:46:17 +0200 Subject: Handle ':\n' (no space after colon) --- libstorycode/storycode.l | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libstorycode/storycode.l b/libstorycode/storycode.l index 18cd95a..cadd771 100644 --- a/libstorycode/storycode.l +++ b/libstorycode/storycode.l @@ -45,6 +45,7 @@ %s sqb %x stringesc %x runtext +%x prerun %s image %s image_filename @@ -86,7 +87,8 @@ BGCOL { BEGIN(col); return SC_BGCOL; } lineno++; return SC_FILENAME; } -:[ ] { BEGIN(runtext); return SC_TEXT_START; } +: { BEGIN(prerun); return SC_TEXT_START; } +[ ] { BEGIN(runtext); } [\\] { BEGIN(stringesc); } . { sclval.str = strdup(yytext); BEGIN(runtext); return SC_RUN_TEXT; } [\*] { return '*'; } @@ -96,6 +98,7 @@ BGCOL { BEGIN(col); return SC_BGCOL; } sclval.str[yyleng] = '\0'; return SC_RUN_TEXT; } \n { BEGIN(0); lineno++; } +\n { BEGIN(0); lineno++; } \n { BEGIN(0); lineno++; } -- cgit v1.2.3