From ebde44b28b551f670c9e5c4c038d03e94bfbb1d2 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sun, 30 Jul 2017 09:17:44 +0200 Subject: Reorganise: make Position a field in Syntax types --- Sil/Syntax.dcl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'Sil/Syntax.dcl') diff --git a/Sil/Syntax.dcl b/Sil/Syntax.dcl index 1273267..b298c19 100644 --- a/Sil/Syntax.dcl +++ b/Sil/Syntax.dcl @@ -5,11 +5,11 @@ from StdOverloaded import class toString from Data.Maybe import :: Maybe from Sil.Types import :: Type -from Sil.Util.Parser import :: Positioned +from Sil.Util.Parser import :: ParsePosition, class getPos :: Program = - { p_funs :: [Positioned Function] - , p_globals :: [Positioned Initialisation] + { p_funs :: [Function] + , p_globals :: [Initialisation] } :: Function = @@ -17,11 +17,12 @@ from Sil.Util.Parser import :: Positioned , f_name :: Name , f_args :: [Arg] , f_code :: CodeBlock + , f_pos :: ParsePosition } :: CodeBlock = - { cb_init :: [Positioned Initialisation] - , cb_content :: [Positioned Statement] + { cb_init :: [Initialisation] + , cb_content :: [Statement] } :: Arg = @@ -33,6 +34,7 @@ from Sil.Util.Parser import :: Positioned { init_type :: Type , init_name :: Name , init_value :: Maybe Expression + , init_pos :: ParsePosition } :: Statement @@ -86,6 +88,9 @@ instance toString Op1 instance toString Op2 instance toString Literal +instance getPos Function +instance getPos Initialisation + class allStatements a :: a -> [Statement] instance allStatements Program instance allStatements Function -- cgit v1.2.3