Comments kunnen nu eindigen met een EOF ipv newline
[cc1516.git] / src / lex.icl
index fd4b564..63a14e0 100644 (file)
@@ -21,7 +21,7 @@ lexProgram = some lexToken <* many (satisfy isSpace) <* eof
 lexToken :: Parser Char TokenValue
 lexToken = 
     //Comments
-    (list (fromString "//") >>| until top (item '\n') >>| lexToken) <|>
+    (list (fromString "//") >>| until top ((item '\n' >>| return Void) <|> eof) >>| lexToken) <|>
     (list (fromString "/*") >>| until top (list (fromString "*/")) >>| lexToken) <|>
        //Keyword tokens
        (lexKw "var" VarToken) <|>