aboutsummaryrefslogtreecommitdiff
path: root/Sil/Syntax.icl
diff options
context:
space:
mode:
Diffstat (limited to 'Sil/Syntax.icl')
-rw-r--r--Sil/Syntax.icl11
1 files changed, 7 insertions, 4 deletions
diff --git a/Sil/Syntax.icl b/Sil/Syntax.icl
index a8a0631..0749dde 100644
--- a/Sil/Syntax.icl
+++ b/Sil/Syntax.icl
@@ -65,14 +65,17 @@ where
toString (BLit b) = toString b
toString (ILit i) = toString i
+instance getPos Function where getPos f = f.f_pos
+instance getPos Initialisation where getPos i = i.init_pos
+
instance allStatements Program
-where allStatements p = concatMap (allStatements o fromPositioned) p.p_funs
+where allStatements p = concatMap allStatements p.p_funs
instance allStatements Function
where allStatements f = allStatements f.f_code
instance allStatements CodeBlock
-where allStatements cb = concatMap (allStatements o fromPositioned) cb.cb_content
+where allStatements cb = concatMap allStatements cb.cb_content
instance allStatements Statement
where
@@ -87,7 +90,7 @@ where
instance allCodeBlocks Function where allCodeBlocks f = allCodeBlocks f.f_code
instance allCodeBlocks CodeBlock
-where allCodeBlocks cb = [cb:concatMap (allCodeBlocks o fromPositioned) cb.cb_content]
+where allCodeBlocks cb = [cb:concatMap allCodeBlocks cb.cb_content]
instance allCodeBlocks Statement
where
@@ -102,4 +105,4 @@ where
allLocals f.f_code
instance allLocals CodeBlock
-where allLocals cb = [(i.init_type, i.init_name) \\ i <- map fromPositioned cb.cb_init]
+where allLocals cb = [(i.init_type, i.init_name) \\ i <- cb.cb_init]