From: Mart Lubbers Date: Wed, 6 Mar 2019 12:12:23 +0000 (+0100) Subject: cleanup X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=3dd7096cb28972332716390ab62350205df519f8;p=minfp.git cleanup --- diff --git a/check.icl b/check.icl index 68d258a..8a4ea5c 100644 --- a/check.icl +++ b/check.icl @@ -26,6 +26,7 @@ check fs ([Function _ _ _], _) = Left ["Start cannot have arguments"] instance toString Scheme where + toString (Forall [] t) = toString t toString (Forall as t) = concat ["A.", join " " (map toString as), ": ", toString t] instance toString Type where diff --git a/parse.icl b/parse.icl index 0c30e8c..a2c3103 100644 --- a/parse.icl +++ b/parse.icl @@ -26,6 +26,10 @@ instance toString Token where toString t = printToString t lex :: [Char] -> Either [String] [Token] lex [] = pure [] +lex ['//\n':ts] = lex ts +lex ['//',t:ts] = lex ['/','/':ts] +lex ['/**/':ts] = lex $ dropWhile ((<>)'\n') ts +lex ['/*',t:ts] = lex ['/','*':ts] lex [';':ts] = TTSemiColon <:> lex ts lex [')':ts] = TTBrackClose <:> lex ts lex ['(':ts] = TTBrackOpen <:> lex ts