diff options
author | Thomas White <taw@physics.org> | 2019-10-02 09:46:17 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-10-05 17:03:43 +0200 |
commit | 0667ba5a597f5b94c68f414909453648eab2835c (patch) | |
tree | e2d0c80ad46245d92154593f5426e631f9c6ac2b | |
parent | 2085008642f6e96ac369427c59619c58bbd3f15c (diff) |
Handle ':\n' (no space after colon)
-rw-r--r-- | libstorycode/storycode.l | 5 |
1 files changed, 4 insertions, 1 deletions
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; } -<INITIAL>:[ ] { BEGIN(runtext); return SC_TEXT_START; } +<INITIAL>: { BEGIN(prerun); return SC_TEXT_START; } +<prerun>[ ] { BEGIN(runtext); } <runtext>[\\] { BEGIN(stringesc); } <stringesc>. { sclval.str = strdup(yytext); BEGIN(runtext); return SC_RUN_TEXT; } <runtext>[\*] { return '*'; } @@ -96,6 +98,7 @@ BGCOL { BEGIN(col); return SC_BGCOL; } sclval.str[yyleng] = '\0'; return SC_RUN_TEXT; } <runtext>\n { BEGIN(0); lineno++; } +<prerun>\n { BEGIN(0); lineno++; } \n { BEGIN(0); lineno++; } |