Commit 8df1e67f by Zachary Snow

typedef traversal only marks interfaces as such

parent 677d1109
...@@ -25,6 +25,8 @@ convert = ...@@ -25,6 +25,8 @@ convert =
where where
getTypedef :: Description -> Writer Types () getTypedef :: Description -> Writer Types ()
getTypedef (PackageItem (Typedef a b)) = tell $ Map.singleton b a getTypedef (PackageItem (Typedef a b)) = tell $ Map.singleton b a
getTypedef (Part _ Interface _ x _ _) =
tell $ Map.singleton x (InterfaceT x Nothing [])
getTypedef _ = return () getTypedef _ = return ()
removeTypedef :: Description -> Description removeTypedef :: Description -> Description
removeTypedef (PackageItem (Typedef _ x)) = removeTypedef (PackageItem (Typedef _ x)) =
...@@ -71,7 +73,7 @@ resolveType types (Struct p items rs) = Struct p (map (resolveItem types) items) ...@@ -71,7 +73,7 @@ resolveType types (Struct p items rs) = Struct p (map (resolveItem types) items)
resolveType types (Union p items rs) = Union p (map (resolveItem types) items) rs resolveType types (Union p items rs) = Union p (map (resolveItem types) items) rs
resolveType types (Alias Nothing st rs1) = resolveType types (Alias Nothing st rs1) =
if Map.notMember st types if Map.notMember st types
then InterfaceT st Nothing rs1 then Alias Nothing st rs1
else case resolveType types $ types Map.! st of else case resolveType types $ types Map.! st of
(Net kw rs2) -> Net kw $ rs1 ++ rs2 (Net kw rs2) -> Net kw $ rs1 ++ rs2
(Implicit sg rs2) -> Implicit sg $ rs1 ++ rs2 (Implicit sg rs2) -> Implicit sg $ rs1 ++ rs2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment