diff options
author | Camil Staps | 2017-07-30 09:17:44 +0200 |
---|---|---|
committer | Camil Staps | 2017-07-30 09:17:44 +0200 |
commit | ebde44b28b551f670c9e5c4c038d03e94bfbb1d2 (patch) | |
tree | 7d021edb338a4fc6210a38fb2d3f0dafdda85ec2 /Sil/Syntax.icl | |
parent | Force logical order of output in cli (diff) |
Reorganise: make Position a field in Syntax types
Diffstat (limited to 'Sil/Syntax.icl')
-rw-r--r-- | Sil/Syntax.icl | 11 |
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] |