Commit b751c0b4 authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

New debugging info, documentation

parent e26110cf
......@@ -56,7 +56,7 @@ kindCheck env (Module m es is ds)
-- |Check for a correct syntax.
--
-- * Declarations: Nullary data constructors and variables are
-- disambiguated
-- disambiguated, variables are renamed
-- * Environment: remains unchanged
syntaxCheck :: Options -> CompilerEnv -> Module -> CheckResult (CompilerEnv, Module)
syntaxCheck opts env (Module m es is ds)
......@@ -66,8 +66,10 @@ syntaxCheck opts env (Module m es is ds)
(valueEnv env) (tyConsEnv env) ds
-- |Check the precedences of infix operators.
-- In addition, the abstract syntax tree is rearranged to reflect the
-- relative precedences; the operator precedence environment is updated.
--
-- * Declarations: Expressions are reordered according to the specified
-- precedences
-- * Environment: The operator precedence environment is updated
precCheck :: CompilerEnv -> Module -> CheckResult (CompilerEnv, Module)
precCheck env (Module m es is ds)
| null msgs = CheckSuccess (env { opPrecEnv = pEnv' }, Module m es is ds')
......
......@@ -43,6 +43,7 @@ data Options = Options
, optTargetTypes :: [TargetType] -- ^ what to generate
, optExtensions :: [Extension] -- ^ enabled language extensions
, optDumps :: [DumpLevel] -- ^ dump levels
, optDumpEnv :: Bool -- ^ dump compilation environment
}
-- | Default compiler options
......@@ -61,6 +62,7 @@ defaultOptions = Options
, optTargetTypes = []
, optExtensions = []
, optDumps = []
, optDumpEnv = False
}
data CymakeMode
......@@ -241,6 +243,9 @@ options =
, Option "" ["dump-case"]
(NoArg (\ opts -> opts { optDumps = nub $ DumpCase : optDumps opts }))
"dump intermediate language after case simplification"
, Option "" ["dump-env"]
(NoArg (\ opts -> opts { optDumpEnv = True }))
"dump compilation environment for each dump level"
]
-- |Parse the command line arguments
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment