@@ -8,7 +8,7 @@ import Control.Exception
88import System.IO.Error
99
1010import CorePrelude
11- import Evaluators.TemplateInstantiation.Evaluator
11+ import Evaluators.TemplateInstantiation
1212import Evaluators.TemplateInstantiation.State
1313import Language
1414import Lexer
@@ -24,7 +24,7 @@ data FLCConfig = FLCConfig
2424flcConfig :: Parser FLCConfig
2525flcConfig =
2626 FLCConfig
27- <$> many (argument str (metavar " FILES" <> help " source files " ))
27+ <$> many (argument str (metavar " FILES" <> help " Source file(s) " ))
2828 <*> switch
2929 (long " verbose" <> short ' v' <> help
3030 " Print extra debugging information"
@@ -72,7 +72,7 @@ performCompileAndPrint FLCConfig { verbose = True } fileContents = mapM_
7272 , (" Parsed AST" , show program)
7373 , (" Prelude" , pprint $ preludeDefs ++ extraPreludeDefs)
7474 , (" Pretty-printed program" , pprint program)
75- , (" Evaluation trace" , showResults results)
75+ , (" Evaluation trace" , showTrace results)
7676 , (" Program output" , result)
7777 ]
7878 (tokens, program, results, result) = performCompile fileContents
@@ -81,11 +81,13 @@ performCompileAndPrint _ fileContents = putStrLn result
8181
8282-- Helper to get outputs of compilation stages
8383-- Note: separately lexes and parses each files, and joins together
84- -- the scDefs into one program.
84+ -- the scDefs into one program. Does not simply concatenate files due
85+ -- to the specifics of the grammar (strict interleaving of semicolons
86+ -- between supercombinators, and no trailing semicolons).
8587performCompile :: [String ] -> ([Token ], CoreProgram , [TiState ], String )
8688performCompile fileContents = (concat tokens, program, results, result)
8789 where
88- result = showDataNode . getResult $ results
90+ result = showOutput results
8991 results = eval . compile $ program
9092 program = concat asts
9193 asts = syntax <$> tokens
0 commit comments