From bb762e08e950b4d6d16bf0782c3e8d689f28c5dc Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sun, 13 Aug 2017 19:21:43 +0200 Subject: Improved compiler interface (#8) Specifically: - --check, --compile and --generate are implicit, there are --no-* options to disable. - --help added. - --run removed. - Renamed to silc (sil compiler). - Output files are relative to input file. --- Sil/Util/Parser.icl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Sil/Util/Parser.icl') diff --git a/Sil/Util/Parser.icl b/Sil/Util/Parser.icl index e730313..154a989 100644 --- a/Sil/Util/Parser.icl +++ b/Sil/Util/Parser.icl @@ -1,6 +1,6 @@ implementation module Sil.Util.Parser -from StdFunc import iter +from StdFunc import iter, o import StdList import StdOverloaded @@ -140,6 +140,9 @@ where item :: a -> Parser a a | ==, name, toString a item a = satisfy ((==) a) <#> name a +anyItem :: ([a] -> Parser a a) | ==, name, toString a +anyItem = foldr (<|>) empty o map item + list :: [a] -> Parser a [a] | ==, name, toString a list as = mapM item as -- cgit v1.2.3