repositories
/
cc1516.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
small update so that retyping works
[cc1516.git]
/
lex.icl
diff --git
a/lex.icl
b/lex.icl
index
e3fb2c1
..
aa34987
100644
(file)
--- a/
lex.icl
+++ b/
lex.icl
@@
-1,15
+1,16
@@
implementation module lex
import Control.Monad, Control.Applicative
implementation module lex
import Control.Monad, Control.Applicative
-import Data.Either, Data.Func
+import Data.Either, Data.Func
, Data.Void
from StdFunc import o
import StdBool
import StdList
import StdChar
import StdString
from StdFunc import o
import StdBool
import StdList
import StdChar
import StdString
+import StdTuple
import yard
import yard
-from AST import :: Pos(..)
+import AST
:: LexItem
= LexToken Int TokenValue
:: LexItem
= LexToken Int TokenValue
@@
-19,9
+20,7
@@
from AST import :: Pos(..)
| LexItemError String
lexer :: [Char] -> LexerOutput
| LexItemError String
lexer :: [Char] -> LexerOutput
-lexer r = case runParser (lexProgram 1 1) r of
- (Right p, _) = Right p
- (Left e, _) = Left e
+lexer r = fst $ runParser (lexProgram 1 1) r
lexProgram :: Int Int -> Parser Char [Token]
lexProgram line column = lexToken >>= \t->case t of
lexProgram :: Int Int -> Parser Char [Token]
lexProgram line column = lexToken >>= \t->case t of