git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #836 from purescript/816
bbed315Phil Freeman
src/Language/PureScript/CodeGen/Externs.hs+9−2
@@ -45,8 +45,15 @@ moduleToPs (Module moduleName ds (Just exts)) env = intercalate "\n" . execWrite
45
45
46 declToPs :: Declaration -> Writer [String] ()
46 declToPs :: Declaration -> Writer [String] ()
47 declToPs (ImportDeclaration mn _ _) = tell ["import " ++ show mn ++ " ()"]
47 declToPs (ImportDeclaration mn _ _) = tell ["import " ++ show mn ++ " ()"]
48− declToPs (FixityDeclaration (Fixity assoc prec) ident) =
48+ declToPs (FixityDeclaration (Fixity assoc prec) op) =
49+ case find exportsOp exts of
50+ Nothing -> return ()
49− tell [ unwords [ show assoc, show prec, ident ] ]
51+ Just _ -> tell [ unwords [ show assoc, show prec, op ] ]
52+ where
53+ exportsOp :: DeclarationRef -> Bool
54+ exportsOp (PositionedDeclarationRef _ _ r) = exportsOp r
55+ exportsOp (ValueRef ident') = ident' == Op op
56+ exportsOp _ = False
50 declToPs (PositionedDeclaration _ com d) = mapM commentToPs com >> declToPs d
57 declToPs (PositionedDeclaration _ com d) = mapM commentToPs com >> declToPs d
51 declToPs _ = return ()
58 declToPs _ = return ()
52
59