summaryrefslogtreecommitdiff
path: root/DSL/Parsing.hs
diff options
context:
space:
mode:
authorMatthew Hall <hallmatthew314@gmail.com>2023-02-18 16:58:51 +1300
committerMatthew Hall <hallmatthew314@gmail.com>2023-02-18 16:58:51 +1300
commit8c33b3d2c69b6800ca34155d62c000250980e47e (patch)
tree3e3b5a090de5e0bc5e73e0a81271361e1ffe4e3d /DSL/Parsing.hs
parentf8a928d18371e0b67741f5d75b8154d1c105327b (diff)
Introduce stdlib and fix lexing bug
Diffstat (limited to 'DSL/Parsing.hs')
-rw-r--r--DSL/Parsing.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/DSL/Parsing.hs b/DSL/Parsing.hs
index d255c35..ba6a5ee 100644
--- a/DSL/Parsing.hs
+++ b/DSL/Parsing.hs
@@ -11,7 +11,7 @@ buildDSLLexer p t = do
return Token { tStr=str, tTag=t }
fromStringL :: String -> TokenTag -> DSLLexer
-fromStringL s t = buildDSLLexer (list s) t
+fromStringL s t = buildDSLLexer (list s) t <* peek (() <$ satisfy isSpace `alt` eof)
fromTableL :: [(String, TokenTag)] -> DSLLexer
fromTableL table = firstOf $ map (uncurry fromStringL) table