From ca0230e700099b456ec47b7a705ca5d1e6db2841 Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Sun, 19 May 2019 00:29:49 +0100 Subject: [PATCH] Generate code for externs --- Main.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Main.hs b/Main.hs index 2eae262..cf20ab8 100644 --- a/Main.hs +++ b/Main.hs @@ -41,6 +41,9 @@ buildAST (Function (Prototype nameStr paramStrs) body) = do flip runReaderT binds $ buildExpr body >>= ret where params = zip (repeat Type.double) (map fromString paramStrs) +buildAST (Extern (Prototype nameStr params)) = + extern (fromString nameStr) (replicate (length params) Type.double) Type.double + buildAST (TopLevelExpr x) = function "__anon_expr" [] Type.double $ const $ flip runReaderT mempty $ buildExpr x >>= ret -- 2.30.2