diff options
Diffstat (limited to 'src/main/frege/buildclient/config/BuildParser.fr')
-rw-r--r-- | src/main/frege/buildclient/config/BuildParser.fr | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/frege/buildclient/config/BuildParser.fr b/src/main/frege/buildclient/config/BuildParser.fr index 23e15ff..367b177 100644 --- a/src/main/frege/buildclient/config/BuildParser.fr +++ b/src/main/frege/buildclient/config/BuildParser.fr @@ -29,7 +29,7 @@ lexer s = lex s 0 private lex :: String -> Int -> [Token] private lex !cs !start - | endOfSeq = [] + | start >= cs.length = [] | ch == '\\' && at 1 == '\n' = lex cs (start + 2) | ch == '\n' = Token.NewLine : lex cs (start + 1) | ch.isWhitespace = lex cs (start + 1) @@ -38,9 +38,8 @@ private lex !cs !start | ch == '}' = Token.BraceClose : lex cs (start + 1) | isDigit ch = takeWhile isDigit Token.Number 0 [] | isIdentifierStartChar ch = takeWhile isIdentifierChar Token.BareWord 0 [] - | otherwise -> [Token.ERROR{position=start, message="Unexpected character"}] + | otherwise -> [Token.ERROR{position=start, message="Unexpected character " ++ (show ch)}] where - endOfSeq = start >= cs.length ch = at 0 at i = if start + i >= cs.length then '\0' else cs.charAt (start + i) takeWhile charTest mapper off !acc |