X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=spl.icl;h=f398f902e33e858b60fc79b4ca70c26e1ba784f5;hb=fc38bf6ef5716c685ac316fdf3c42e7afce327eb;hp=0a3f1970ec14d1210c54bab4957ee421408badbb;hpb=dd9529f0ce7864e2bf6df4e4973bd2af068985a0;p=cc1516.git diff --git a/spl.icl b/spl.icl index 0a3f197..f398f90 100644 --- a/spl.icl +++ b/spl.icl @@ -24,7 +24,6 @@ from yard import :: Error, instance toString Error program :: String, lex :: Bool, parse :: Bool, - selftest :: Bool, fp :: Maybe String, help :: Bool} @@ -50,7 +49,6 @@ Start w <<< " --version Show the version\n" <<< " --[no-]lex Lexer output(default: disabled)\n" <<< " --[no-]parse Parser output(default: enabled)\n" - <<< " --[no-]selftest Feed pprint parse back(default: disabled)\n" = snd $ fclose stdin w # (contents, stdin, w) = readFileOrStdin stdin args.fp w = case contents of @@ -59,12 +57,12 @@ Start w # lexOut = lexer cs # stdin = if (not args.lex) stdin (case lexOut of (Right toks) = - stdin <<< "---LEXER\n" <<< printTokens toks <<< "---LEXER\n" + stdin <<< "//LEXER\n" <<< printTokens toks <<< "//LEXER\n" _ = stdin) # parseOut = parser lexOut # stdin = if (not args.parse) stdin (case parser lexOut of (Right ast) = - stdin <<< "---PARSER\n" <<< toString ast <<< "---PARSER\n" + stdin <<< "//PARSER\n" <<< toString ast <<< "//PARSER\n" (Left parse) = stdin <<< toString parse) = snd $ fclose stdin w where @@ -93,8 +91,6 @@ where pa ["--no-lex":r] o = pa r {o & lex=False} pa ["--parse":r] o = pa r {o & parse=True} pa ["--no-parse":r] o = pa r {o & parse=False} - pa ["--selftest":r] o = pa r {o & selftest=True} - pa ["--no-selftest":r] o = pa r {o & selftest=False} pa [x:r] o = pa r {o & fp=Just x} readFileOrStdin :: *File (Maybe String) *World -> *(Either String [Char], *File, *World)