on master help sign in
Code cleanup
commit43ab5e1093c6d58273a41aa1a9e6608fc0f1de6f authorjmite <jmitdase@gmail.com> dateTue 25 Aug 2015, 11:54 (11 years ago) parentc39e3e0
3 files changed+6−10
src/Canonicalize/Setup.hs+5−8 src/Canonicalize/Variable.hs+1−1 src/Generate/JavaScript/Variable.hs−1
src/Canonicalize/Setup.hs+5−8
@@ -282,20 +282,17 @@ declarationsToPatches moduleName decls =
282282 (Maybe.catMaybes maybeNodes, concat patchLists)
283283
284284
285−-- When canonicalizing, all _values should be Local, except for top-level definitions but all
286−-- For _adts and _patterns,
287−-- we assume constructors are top-evel
288−-- should be fully namespaced. With _adts, they may appear in types that can
285+-- When canonicalizing, all _values should be Local, except for top-level definitions
286+-- However _adts and _patterns
287+-- should be fully namespaced, thought constructors are top_level.
288+-- With _adts, they may appear in types that can
289289-- escape the module.
290290declToPatches
291291 :: Module.Name
292292 -> D.ValidDecl
293293 -> (Maybe Node, [Env.Patch])
294294declToPatches moduleName (A.A (region,_) decl) =
295− let --local mkPatch x =
296− -- mkPatch x (Var.local x)
297−
298− topLevel mkPatch x =
295+ let topLevel mkPatch x =
299296 mkPatch x (Var.topLevel moduleName x )
300297
301298 namespaced mkPatch x =
src/Canonicalize/Variable.hs+1−1
@@ -145,7 +145,7 @@ preferLocals' region env extract kind possibilities var =
145145 ambiguous possibleVars =
146146 Result.err (A.A region (Error.variable kind var Error.Ambiguous vars))
147147 where
148− vars = map (show {-Var.toString-} . extract) possibleVars
148+ vars = map (Var.toString . extract) possibleVars
149149
150150
151151-- NOT FOUND HELPERS
src/Generate/JavaScript/Variable.hs−1
@@ -23,7 +23,6 @@ canonical (Var.Canonical home name) =
2323 home' =
2424 case home of
2525 Var.Local -> []
26− --TODO: change this to act like Module
2726 Var.TopLevel _ -> []
2827 Var.BuiltIn -> []
2928 Var.Module path -> [ moduleName path ]