From: pimjager Date: Mon, 29 Feb 2016 12:45:20 +0000 (+0100) Subject: Merged branch master X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=e4603fe257568bbc124d95dd88ea3b85dcccfa00;p=cc1516.git Merged branch master --- e4603fe257568bbc124d95dd88ea3b85dcccfa00 diff --cc src/main.prj index f2d50f9,177aab2..7ba18dc --- a/src/main.prj +++ b/src/main.prj @@@ -686,23 -685,9 +685,23 @@@ OtherModule ReadableABC: False ReuseUniqueNodes: True Fusion: False + Module + Name: StdMaybe + Dir: {Application}/lib/iTasks-SDK/Dependencies/clean-platform/src/libraries/OS-Independent/Deprecated/StdLib + Compiler + NeverMemoryProfile: False + NeverTimeProfile: False + StrictnessAnalysis: True + ListTypes: StrictExportTypes + ListAttributes: True + Warnings: True + Verbose: True + ReadableABC: False + ReuseUniqueNodes: True + Fusion: False Module Name: System.OS - Dir: {Application}/lib/iTasks-SDK/Dependencies/clean-platform/src/libraries/OS-Mac + Dir: {Application}/lib/iTasks-SDK/Dependencies/Platform/OS-Linux-64 Compiler NeverMemoryProfile: False NeverTimeProfile: False diff --cc src/parse.icl index f5cb0c8,0f0f42c..9fa1377 --- a/src/parse.icl +++ b/src/parse.icl @@@ -173,9 -172,14 +173,15 @@@ trans2 t f = satTok t >>= \(_, r).pure trans1 :: TokenValue a -> Parser Token a trans1 t r = trans2 t $ const r +derive gPrint TokenValue + derive gEq TokenValue satTok :: TokenValue -> Parser Token Token - satTok t = top >>= \tok=:(pos, tv) -> if (t === tok) (return tok) (fail (printToString t, pos)) -satTok t = satisfy $ eq t ++satTok t = top >>= \tok=:(pos, tv) -> if (eq t tok) (return tok) (fail (printToString t, pos)) + where + eq (IdentToken _) (_, IdentToken _) = True + eq (NumberToken _) (_, NumberToken _) = True + eq (CharToken _) (_, CharToken _) = True + eq x (_, y) = gEq {|*|} x y parseSepList :: TokenValue (Parser Token a) -> Parser Token [a] parseSepList sep p =