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/Util/Printer.icl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Sil/Util/Printer.icl') diff --git a/Sil/Util/Printer.icl b/Sil/Util/Printer.icl index 979e478..2a028b6 100644 --- a/Sil/Util/Printer.icl +++ b/Sil/Util/Printer.icl @@ -16,6 +16,7 @@ import Text import Sil.Parse import Sil.Syntax import Sil.Types +import Sil.Util.Parser :: PrintState = { indent :: Int @@ -33,6 +34,9 @@ instance toString PrintState where toString st = {'\t' \\ _ <- [1..st.indent]} instance PrettyPrinter String where print _ s = s +instance PrettyPrinter (Positioned a) | PrettyPrinter a +where print st p = print st $ fromPositioned p + instance PrettyPrinter [Token] where print st [] = "" -- cgit v1.2.3