on master help sign in
cosmetic: change indentation a bit
8b7f7cdEvan Czaplicki
compiler/Transform/Canonicalize/Variable.hs+9−7
@@ -19,14 +19,16 @@ variable env var =
19 where
19 where
20 home = Var.Module (List.intercalate "." ms)
20 home = Var.Module (List.intercalate "." ms)
21
21
22+ _ ->
22− _ -> case Map.lookup var (_values env) of
23+ case Map.lookup var (_values env) of
23− Just [v] -> Env.using v
24+ Just [v] -> Env.using v
24− Just vs -> preferLocals env "variable" vs var
25+ Just vs -> preferLocals env "variable" vs var
25− Nothing -> notFound "variable" (Map.keys (_values env)) var
26+ Nothing -> notFound "variable" (Map.keys (_values env)) var
26 where
27 where
28+ (modul, name) =
27− (modul, name) = case Help.splitDots var of
29+ case Help.splitDots var of
28− [x] -> (Nothing, x)
30+ [x] -> (Nothing, x)
29− xs -> (Just (init xs), last xs)
31+ xs -> (Just (init xs), last xs)
30
32
31tvar :: Environment -> String
33tvar :: Environment -> String
32 -> Canonicalizer String (Either Var.Canonical (Var.Canonical, [String], Type.CanonicalType))
34 -> Canonicalizer String (Either Var.Canonical (Var.Canonical, [String], Type.CanonicalType))