diff options
-rw-r--r-- | crawl-ref/source/util/levcomp.lpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/crawl-ref/source/util/levcomp.lpp b/crawl-ref/source/util/levcomp.lpp index 401403ac0d..4cc718855a 100644 --- a/crawl-ref/source/util/levcomp.lpp +++ b/crawl-ref/source/util/levcomp.lpp @@ -68,6 +68,7 @@ static void settext(bool trim_right = false, int strip_trailing = 0) %x MAPDEF %x LUA +%x LUA_ONELINER %s ARGUMENT %s MNAME %s KEYWORDS @@ -103,7 +104,13 @@ NSPACE [^\ \t\r\n] settext(); return LUA_LINE; } -<LUA>\r?\n ; +<LUA>\r?\n ; + +<LUA_ONELINER>[^\r\n]+$ { + settext(); + return LUA_LINE; + } +<LUA_ONELINER>\r?\n { BEGIN(INITIAL); } <KEYWORDS>[A-Za-z_0-9\-]+ { settext(); @@ -149,6 +156,7 @@ NSPACE [^\ \t\r\n] ^\s*MAP { BEGIN(MAPDEF); } +^: { BEGIN(LUA_ONELINER); return MAIN; } ^prelude[ \t]*\{\{ { BEGIN(LUA); return PRELUDE; } ^lua[ \t]*\{\{ { BEGIN(LUA); return MAIN; } |