Resolve conflicts after merge.
This commit is contained in:
parent
36e7353ee7
commit
13ea7f2c4b
|
@ -28,6 +28,8 @@ import Data.Maybe
|
||||||
import qualified AST as A
|
import qualified AST as A
|
||||||
import CompState
|
import CompState
|
||||||
import Errors
|
import Errors
|
||||||
|
import ImplicitMobility
|
||||||
|
import Metadata
|
||||||
import Pass
|
import Pass
|
||||||
import qualified Properties as Prop
|
import qualified Properties as Prop
|
||||||
import RainTypes
|
import RainTypes
|
||||||
|
|
|
@ -212,7 +212,8 @@ testRecordInfNames0 = TestCase $ testPassWithStateCheck "testRecordInfNames0" ex
|
||||||
orig = (A.Rep m (A.ForEach m (simpleName "c") (makeLiteralStringRain "hello")) skipP)
|
orig = (A.Rep m (A.ForEach m (simpleName "c") (makeLiteralStringRain "hello")) skipP)
|
||||||
exp = orig
|
exp = orig
|
||||||
check state = assertVarDef "testRecordInfNames0" state "c"
|
check state = assertVarDef "testRecordInfNames0" state "c"
|
||||||
(tag7 A.NameDef DontCare "c" "c" A.VariableName (A.Declaration m A.Byte ) A.Abbrev A.Unplaced)
|
(tag6 A.NameDef DontCare "c" "c"
|
||||||
|
(A.Declaration m $ A.UnknownVarType $ Left $ simpleName "c") A.Abbrev A.Unplaced)
|
||||||
|
|
||||||
-- | checks that c's type is recorded in: ***each (c : str) {}, where str is known to be of type string
|
-- | checks that c's type is recorded in: ***each (c : str) {}, where str is known to be of type string
|
||||||
testRecordInfNames1 :: Test
|
testRecordInfNames1 :: Test
|
||||||
|
@ -223,7 +224,8 @@ testRecordInfNames1 = TestCase $ testPassWithStateCheck "testRecordInfNames1" ex
|
||||||
orig = (A.Rep m (A.ForEach m (simpleName "c") (exprVariable "str")) skipP)
|
orig = (A.Rep m (A.ForEach m (simpleName "c") (exprVariable "str")) skipP)
|
||||||
exp = orig
|
exp = orig
|
||||||
check state = assertVarDef "testRecordInfNames1" state "c"
|
check state = assertVarDef "testRecordInfNames1" state "c"
|
||||||
(tag7 A.NameDef DontCare "c" "c" A.VariableName (A.Declaration m A.Byte ) A.Abbrev A.Unplaced)
|
(tag6 A.NameDef DontCare "c" "c"
|
||||||
|
(A.Declaration m $ A.UnknownVarType $ Left $ simpleName "c") A.Abbrev A.Unplaced)
|
||||||
|
|
||||||
-- | checks that c's and d's type are recorded in: ***each (c : multi) { seqeach (d : c) {} } where multi is known to be of type [string]
|
-- | checks that c's and d's type are recorded in: ***each (c : multi) { seqeach (d : c) {} } where multi is known to be of type [string]
|
||||||
testRecordInfNames2 :: Test
|
testRecordInfNames2 :: Test
|
||||||
|
@ -235,15 +237,13 @@ testRecordInfNames2 = TestCase $ testPassWithStateCheck "testRecordInfNames2" ex
|
||||||
A.Only m $ A.Seq m $ A.Rep m (A.ForEach m (simpleName "d") (exprVariable "c")) skipP
|
A.Only m $ A.Seq m $ A.Rep m (A.ForEach m (simpleName "d") (exprVariable "c")) skipP
|
||||||
exp = orig
|
exp = orig
|
||||||
check state = do assertVarDef "testRecordInfNames2" state "c"
|
check state = do assertVarDef "testRecordInfNames2" state "c"
|
||||||
(tag7 A.NameDef DontCare "c" "c" A.VariableName (A.Declaration m (A.List A.Byte) ) A.Abbrev A.Unplaced)
|
(tag6 A.NameDef DontCare "c" "c"
|
||||||
|
(A.Declaration m $ A.UnknownVarType $ Left $ simpleName
|
||||||
|
"c") A.Abbrev A.Unplaced)
|
||||||
assertVarDef "testRecordInfNames2" state "d"
|
assertVarDef "testRecordInfNames2" state "d"
|
||||||
(tag7 A.NameDef DontCare "d" "d" A.VariableName (A.Declaration m A.Byte ) A.Abbrev A.Unplaced)
|
(tag6 A.NameDef DontCare "d" "d"
|
||||||
|
(A.Declaration m $ A.UnknownVarType $ Left $ simpleName
|
||||||
-- | checks that doing a foreach over a non-array type is barred:
|
"d") A.Abbrev A.Unplaced)
|
||||||
testRecordInfNames3 :: Test
|
|
||||||
testRecordInfNames3 = TestCase $ testPassShouldFail "testRecordInfNames3" (recordInfNameTypes orig) (return ())
|
|
||||||
where
|
|
||||||
orig = A.Rep m (A.ForEach m (simpleName "c") (intLiteral 0)) skipP
|
|
||||||
|
|
||||||
--Easy way to string two passes together; creates a pass-like function that applies the left-hand pass then the right-hand pass. Associative.
|
--Easy way to string two passes together; creates a pass-like function that applies the left-hand pass then the right-hand pass. Associative.
|
||||||
(>>>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
|
(>>>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
|
||||||
|
|
|
@ -141,10 +141,14 @@ recordInfNameTypes = checkDepthM recordInfNameTypes'
|
||||||
where
|
where
|
||||||
recordInfNameTypes' :: Check A.Replicator
|
recordInfNameTypes' :: Check A.Replicator
|
||||||
recordInfNameTypes' input@(A.ForEach m n e)
|
recordInfNameTypes' input@(A.ForEach m n e)
|
||||||
= do let innerT = A.UnknownVarType $ Left n
|
= let innerT = A.UnknownVarType $ Left n in
|
||||||
defineName n A.NameDef {A.ndMeta = m, A.ndName = A.nameName n, A.ndOrigName = A.nameName n,
|
defineName n A.NameDef { A.ndMeta = m
|
||||||
A.ndNameType = A.VariableName, A.ndSpecType = (A.Declaration m innerT),
|
, A.ndName = A.nameName n
|
||||||
A.ndAbbrevMode = A.Abbrev, A.ndPlacement = A.Unplaced}
|
, A.ndOrigName = A.nameName n
|
||||||
|
, A.ndSpecType = A.Declaration m innerT
|
||||||
|
, A.ndAbbrevMode = A.Abbrev
|
||||||
|
, A.ndPlacement = A.Unplaced
|
||||||
|
}
|
||||||
recordInfNameTypes' _ = return ()
|
recordInfNameTypes' _ = return ()
|
||||||
|
|
||||||
markReplicators :: PassType
|
markReplicators :: PassType
|
||||||
|
|
Loading…
Reference in New Issue
Block a user