REPL import warning; version info in CLI
All checks were successful
Test, Build, and Release / test (push) Successful in 1m18s
Test, Build, and Release / build (push) Successful in 1m13s

Adds the ability to toggle result decoding in REPL. Adds several more
useful functions to the base library.
This commit is contained in:
2025-01-30 14:19:30 -06:00
parent bf1000d174
commit 7d1b6a741d
11 changed files with 142 additions and 61 deletions

View File

@ -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