X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=src%2Flex.dcl;h=e78d495a938dfe2fe934934f3a2bc168333f4329;hb=f5231ebadae1ac54e25dbf5819debb3ab625826d;hp=df25ea88b54b652632d7fbf49d9df4723a45fffd;hpb=eb91d7c6b2010be6a43de0a978373654ba3deacc;p=cc1516.git diff --git a/src/lex.dcl b/src/lex.dcl index df25ea8..e78d495 100644 --- a/src/lex.dcl +++ b/src/lex.dcl @@ -1,8 +1,12 @@ definition module lex from Data.Either import :: Either +from yard import :: Error -:: Token :== (Int, Int, TokenValue) +:: Token = { + line :: Int, + column :: Int, + token :: TokenValue} :: TokenValue //Value tokens = IdentToken String // Identifier @@ -53,6 +57,6 @@ from Data.Either import :: Either //Special tokens | EndOfFileToken // EOF -:: LexerOutput :== Either String [Token] +:: LexerOutput :== Either Error [Token] lexer :: [Char] -> LexerOutput