Altered transformProtocolInput to only bother flattening inputs with more than one item

This commit is contained in:
Neil Brown 2008-02-27 17:01:19 +00:00
parent 9b570996ca
commit 5c7bb1296b
2 changed files with 2 additions and 2 deletions

View File

@ -519,7 +519,7 @@ testTransformProtocolInput :: Test
testTransformProtocolInput = TestList
[
TestCase $ testPass "testTransformProtocolInput0"
(A.Seq emptyMeta $ A.Several emptyMeta [onlySingle ii0])
(seqItems [ii0])
(transformProtocolInput $ seqItems [ii0])
(return ())
,TestCase $ testPass "testTransformProtocolInput1"

View File

@ -219,7 +219,7 @@ transformProtocolInput = doGeneric `extM` doProcess
doGeneric = makeGeneric transformProtocolInput
doProcess :: A.Process -> PassM A.Process
doProcess (A.Input m v (A.InputSimple m' iis))
doProcess (A.Input m v (A.InputSimple m' iis@(_:_:_)))
= return $ A.Seq m $ A.Several m $
map (A.Only m . A.Input m v . A.InputSimple m' . singleton) iis
doProcess p = doGeneric p