- (Left e) = (Left e, Left "", w)
- (Right cs) = let lexOut = lexer cs in (lexOut, parser lexOut, w)
+ (Left cs) = snd $ fclose (stdin <<< cs) w
+ (Right cs)
+ # lexOut = lexer cs
+ # stdin = if (not args.lex) stdin (case lexOut of
+ (Left lex) = stdin <<< toString lex
+ (Right toks) = stdin <<<
+ concat (map (\(_, _, t)->printToString t +++ "\n") toks))
+ # parseOut = parser lexOut
+ # stdin = if (not args.parse) stdin (case parser lexOut of
+ (Left parse) = stdin <<< toString parse
+ (Right ast) = stdin <<< toString ast)
+ = snd $ fclose stdin w