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.dcl | |
parent | Force logical order of output in cli (diff) |
Reorganise: make Position a field in Syntax types
Diffstat (limited to 'Sil/Syntax.dcl')
-rw-r--r-- | Sil/Syntax.dcl | 15 |
1 files changed, 10 insertions, 5 deletions
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 |