repositories
/
cc1516.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3952a06
)
better lexer
author
Mart Lubbers
<mart@martlubbers.net>
Tue, 1 Mar 2016 15:41:54 +0000
(16:41 +0100)
committer
Mart Lubbers
<mart@martlubbers.net>
Tue, 1 Mar 2016 15:41:54 +0000
(16:41 +0100)
src/lex.icl
patch
|
blob
|
history
diff --git
a/src/lex.icl
b/src/lex.icl
index
1828e37
..
ac5168f
100644
(file)
--- a/
src/lex.icl
+++ b/
src/lex.icl
@@
-15,8
+15,8
@@
lexer r = case runParser lexProgram r of
(Left e, _) = Left $ toString e
lexProgram :: Parser Char [Token]
-lexProgram = some lexToken <* eof
- >>= \ts->pure $ (map (\t->(0, 0, t))
(catMaybes ts)
)
+lexProgram =
catMaybes <$>
some lexToken <* eof
+ >>= \ts->pure $ (map (\t->(0, 0, t))
ts
)
lexToken :: Parser Char (Maybe TokenValue)
lexToken =