REPL import warning; version info in CLI
Adds the ability to toggle result decoding in REPL. Adds several more useful functions to the base library.
This commit is contained in:
@ -60,7 +60,8 @@ preprocessFile' inProgress filePath
|
||||
Right asts -> do
|
||||
let (imports, nonImports) = partition isImport asts
|
||||
let newInProgress = Set.insert filePath inProgress
|
||||
importedASTs <- concat <$> mapM (processImport newInProgress "") imports
|
||||
importedASTs <- concat <$>
|
||||
mapM (processImport newInProgress "") imports
|
||||
pure $ importedASTs ++ nonImports
|
||||
where
|
||||
isImport :: TricuAST -> Bool
|
||||
@ -116,13 +117,20 @@ nsBodyScoped moduleName args body = case body of
|
||||
if name `elem` args
|
||||
then SVar name
|
||||
else nsBody moduleName (SVar name)
|
||||
SApp func arg -> SApp (nsBodyScoped moduleName args func) (nsBodyScoped moduleName args arg)
|
||||
SLambda innerArgs innerBody -> SLambda innerArgs (nsBodyScoped moduleName (args ++ innerArgs) innerBody)
|
||||
SList items -> SList (map (nsBodyScoped moduleName args) items)
|
||||
TFork left right -> TFork (nsBodyScoped moduleName args left) (nsBodyScoped moduleName args right)
|
||||
TStem subtree -> TStem (nsBodyScoped moduleName args subtree)
|
||||
SApp func arg ->
|
||||
SApp (nsBodyScoped moduleName args func) (nsBodyScoped moduleName args arg)
|
||||
SLambda innerArgs innerBody ->
|
||||
SLambda innerArgs (nsBodyScoped moduleName (args ++ innerArgs) innerBody)
|
||||
SList items ->
|
||||
SList (map (nsBodyScoped moduleName args) items)
|
||||
TFork left right ->
|
||||
TFork (nsBodyScoped moduleName args left)
|
||||
(nsBodyScoped moduleName args right)
|
||||
TStem subtree ->
|
||||
TStem (nsBodyScoped moduleName args subtree)
|
||||
SDef name innerArgs innerBody ->
|
||||
SDef (nsVariable moduleName name) innerArgs (nsBodyScoped moduleName (args ++ innerArgs) innerBody)
|
||||
SDef (nsVariable moduleName name) innerArgs
|
||||
(nsBodyScoped moduleName (args ++ innerArgs) innerBody)
|
||||
other -> other
|
||||
|
||||
isPrefixed :: String -> Bool
|
||||
|
Reference in New Issue
Block a user