Allow multiline expressions

This commit is contained in:
2025-01-20 19:20:29 -06:00
committed by James Eversole
parent eeaf9e0289
commit ec0a6b7b16
7 changed files with 336 additions and 262 deletions

View File

@ -61,7 +61,10 @@ lnewline :: Lexer LToken
lnewline = char '\n' *> pure LNewline
sc :: Lexer ()
sc = space space1 (skipLineComment "--") (skipBlockComment "|-" "-|")
sc = space
(void $ takeWhile1P (Just "space") (\c -> c == ' ' || c == '\t'))
(skipLineComment "--")
(skipBlockComment "|-" "-|")
tricuLexer :: Lexer [LToken]
tricuLexer = do
@ -75,7 +78,8 @@ tricuLexer = do
pure tokens
where
tricuLexer' =
[ try identifier
[ try lnewline
, try identifier
, try keywordT
, try integerLiteral
, try stringLiteral