From 05a47988d9466b827f7dbab44bab33a67228efe9 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sun, 30 Jul 2017 00:51:48 +0200 Subject: Start with positional errors (see #5) --- Sil/Syntax.icl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Sil/Syntax.icl') diff --git a/Sil/Syntax.icl b/Sil/Syntax.icl index 65cb5c5..a8a0631 100644 --- a/Sil/Syntax.icl +++ b/Sil/Syntax.icl @@ -10,6 +10,7 @@ import Data.Maybe import Text import Sil.Types +import Sil.Util.Parser import Sil.Util.Printer instance toString Statement @@ -65,13 +66,13 @@ where toString (ILit i) = toString i instance allStatements Program -where allStatements p = concatMap allStatements p.p_funs +where allStatements p = concatMap (allStatements o fromPositioned) p.p_funs instance allStatements Function where allStatements f = allStatements f.f_code instance allStatements CodeBlock -where allStatements cb = concatMap allStatements cb.cb_content +where allStatements cb = concatMap (allStatements o fromPositioned) cb.cb_content instance allStatements Statement where @@ -86,7 +87,7 @@ where instance allCodeBlocks Function where allCodeBlocks f = allCodeBlocks f.f_code instance allCodeBlocks CodeBlock -where allCodeBlocks cb = [cb:concatMap allCodeBlocks cb.cb_content] +where allCodeBlocks cb = [cb:concatMap (allCodeBlocks o fromPositioned) cb.cb_content] instance allCodeBlocks Statement where @@ -101,4 +102,4 @@ where allLocals f.f_code instance allLocals CodeBlock -where allLocals cb = [(i.init_type, i.init_name) \\ i <- cb.cb_init] +where allLocals cb = [(i.init_type, i.init_name) \\ i <- map fromPositioned cb.cb_init] -- cgit v1.2.3