Undo change that broke case input
This commit is contained in:
parent
23e3261e4d
commit
aae24af5d5
|
@ -949,19 +949,21 @@ genInputCase c s
|
|||
-- This handles specs in a slightly odd way, because we can't insert specs into
|
||||
-- the body of a switch.
|
||||
genInputCaseBody :: A.Name -> A.Variable -> CGen () -> A.Structured -> CGen ()
|
||||
genInputCaseBody proto c coll s = genStructured s doV
|
||||
where
|
||||
doV (A.OnlyV _ (A.Variant _ n iis p))
|
||||
= do tell ["case "]
|
||||
genName n
|
||||
tell ["_"]
|
||||
genName proto
|
||||
tell [": {\n"]
|
||||
coll
|
||||
sequence_ $ map (genInputItem c) iis
|
||||
genProcess p
|
||||
tell ["break;\n"]
|
||||
tell ["}\n"]
|
||||
genInputCaseBody proto c coll (A.Spec _ spec s)
|
||||
= genInputCaseBody proto c (genSpec spec coll) s
|
||||
genInputCaseBody proto c coll (A.OnlyV _ (A.Variant _ n iis p))
|
||||
= do tell ["case "]
|
||||
genName n
|
||||
tell ["_"]
|
||||
genName proto
|
||||
tell [": {\n"]
|
||||
coll
|
||||
sequence_ $ map (genInputItem c) iis
|
||||
genProcess p
|
||||
tell ["break;\n"]
|
||||
tell ["}\n"]
|
||||
genInputCaseBody proto c coll (A.Several _ ss)
|
||||
= sequence_ $ map (genInputCaseBody proto c coll) ss
|
||||
|
||||
genTimerRead :: A.Variable -> A.Variable -> CGen ()
|
||||
genTimerRead c v
|
||||
|
|
|
@ -2,8 +2,9 @@ PROC P ()
|
|||
INT n:
|
||||
SEQ
|
||||
CASE n -- with ELSE
|
||||
INT x:
|
||||
1, 2
|
||||
SKIP
|
||||
x := n
|
||||
3
|
||||
SKIP
|
||||
4, 5, 6, 7, 8
|
||||
|
|
Loading…
Reference in New Issue
Block a user