git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix #816
commit11cc0133e1afabd55f3e4351d4570c293504235f authorPhil Freeman <paf31@cantab.net> dateMon 2 Feb 2015, 20:28 (12 years ago) parent5061808
1 file changed+9−2
src/Language/PureScript/CodeGen/Externs.hs+9−2
src/Language/PureScript/CodeGen/Externs.hs+9−2
@@ -45,8 +45,15 @@ moduleToPs (Module moduleName ds (Just exts)) env = intercalate "\n" . execWrite
4545
4646 declToPs :: Declaration -> Writer [String] ()
4747 declToPs (ImportDeclaration mn _ _) = tell ["import " ++ show mn ++ " ()"]
48− declToPs (FixityDeclaration (Fixity assoc prec) ident) =
49− tell [ unwords [ show assoc, show prec, ident ] ]
48+ declToPs (FixityDeclaration (Fixity assoc prec) op) =
49+ case find exportsOp exts of
50+ Nothing -> return ()
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
5057 declToPs (PositionedDeclaration _ com d) = mapM commentToPs com >> declToPs d
5158 declToPs _ = return ()
5259