diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2022-12-08 14:28:00 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2022-12-08 14:28:00 +0200 |
| commit | 642f073b446cbcee3eb74bad72129fa37e4c6f46 (patch) | |
| tree | 39f43ebc428d3684e7d5584bb12b4c55d4d078f3 /src | |
| parent | 4674bc3a6fa11339d75d55fd82b9574cee587f5d (diff) | |
Fix fn call with zero arguments
Diffstat (limited to 'src')
| -rw-r--r-- | src/Interpreter.hs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/Interpreter.hs b/src/Interpreter.hs index c5c19e0..ca87a82 100644 --- a/src/Interpreter.hs +++ b/src/Interpreter.hs @@ -20,9 +20,7 @@ import Tokenizer ( tokenize' ) import Parser ( parse ) curryCall :: [AST] -> ASTNode -> LContext AST -curryCall [] (ASTFunction fIsPure f) = do - checkPurity fIsPure - f (makeNonsenseAST ASTUnit) +curryCall [] astNode = return $ makeNonsenseAST astNode curryCall (arg:[]) (ASTFunction fIsPure f) = do checkPurity fIsPure f arg @@ -33,7 +31,6 @@ curryCall (arg:rest) f = do checkPurity fIsPure f' arg other -> throwL (astPos g) $ "cannot call value " ++ show other ++ " as a function" -curryCall _ astFn = throwL "" $ "unreachable: curryCall, astFn: " ++ show astFn traverseAndReplace :: String -> AST -> AST -> AST traverseAndReplace param arg ast@AST { an = ASTSymbol sym } |
