Undo change that broke case input

This commit is contained in:
Adam Sampson 2007-04-20 01:19:59 +00:00
parent 23e3261e4d
commit aae24af5d5
2 changed files with 17 additions and 14 deletions

View File

@ -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

View File

@ -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