X-Git-Url: https://git.lukelau.me/?a=blobdiff_plain;f=Main.hs;fp=Main.hs;h=cf20ab898fa2bd9744d698f29ee8dffea73b1bfe;hb=4b65729d043c6a4401828115bfc5e4d63c8006b0;hp=2eae262967be844fff1886ac2d34318912b17e53;hpb=29c339d21438a250d1734e5ddade1b3e2aa18c35;p=kaleidoscope-hs.git 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