Moved a function from RainPassesTest into TestUtil
This commit is contained in:
parent
ebdc084810
commit
4221b0d698
|
@ -356,4 +356,15 @@ buildExpr (Var n) = A.ExprVariable m $ variable n
|
||||||
buildExpr (DirVar dir n) = A.ExprVariable m $ (A.DirectedVariable m dir $ variable n)
|
buildExpr (DirVar dir n) = A.ExprVariable m $ (A.DirectedVariable m dir $ variable n)
|
||||||
buildExpr (Lit e) = e
|
buildExpr (Lit e) = e
|
||||||
|
|
||||||
|
-- | A simple definition of a variable
|
||||||
|
simpleDef :: String -> A.SpecType -> A.NameDef
|
||||||
|
simpleDef n sp = A.NameDef {A.ndMeta = m, A.ndName = n, A.ndOrigName = n, A.ndNameType = A.VariableName,
|
||||||
|
A.ndType = sp, A.ndAbbrevMode = A.Original, A.ndPlacement = A.Unplaced}
|
||||||
|
|
||||||
|
-- | A simple definition of a declared variable
|
||||||
|
simpleDefDecl :: String -> A.Type -> A.NameDef
|
||||||
|
simpleDefDecl n t = simpleDef n (A.Declaration m t)
|
||||||
|
|
||||||
|
-- | A pattern that will match simpleDef, with a different abbreviation mode
|
||||||
|
simpleDefPattern :: String -> A.AbbrevMode -> Pattern -> Pattern
|
||||||
|
simpleDefPattern n am sp = tag7 A.NameDef DontCare n n A.VariableName sp am A.Unplaced
|
||||||
|
|
|
@ -38,16 +38,6 @@ import Data.Generics
|
||||||
import Utils
|
import Utils
|
||||||
import Errors
|
import Errors
|
||||||
|
|
||||||
simpleDef :: String -> A.SpecType -> A.NameDef
|
|
||||||
simpleDef n sp = A.NameDef {A.ndMeta = m, A.ndName = n, A.ndOrigName = n, A.ndNameType = A.VariableName,
|
|
||||||
A.ndType = sp, A.ndAbbrevMode = A.Original, A.ndPlacement = A.Unplaced}
|
|
||||||
|
|
||||||
simpleDefDecl :: String -> A.Type -> A.NameDef
|
|
||||||
simpleDefDecl n t = simpleDef n (A.Declaration m t)
|
|
||||||
|
|
||||||
simpleDefPattern :: String -> A.AbbrevMode -> Pattern -> Pattern
|
|
||||||
simpleDefPattern n am sp = tag7 A.NameDef DontCare n n A.VariableName sp am A.Unplaced
|
|
||||||
|
|
||||||
skipP :: A.Structured
|
skipP :: A.Structured
|
||||||
skipP = A.OnlyP m (A.Skip m)
|
skipP = A.OnlyP m (A.Skip m)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user