tools/PascalParser.hs
changeset 6387 3dcb839b5904
parent 6386 7d7703b26bda
child 6388 14718b2685a3
equal deleted inserted replaced
6386:7d7703b26bda 6387:3dcb839b5904
   480     return $ WhileCycle e o
   480     return $ WhileCycle e o
   481 
   481 
   482 withBlock = do
   482 withBlock = do
   483     try $ string "with"
   483     try $ string "with"
   484     comments
   484     comments
   485     (r:rs) <- (commaSep1 pas) reference
   485     rs <- (commaSep1 pas) reference
   486     comments
   486     comments
   487     string "do"
   487     string "do"
   488     comments
   488     comments
   489     o <- phrase
   489     o <- phrase
   490     return $ WithBlock r (foldl (\ph r -> WithBlock r ph) o rs)
   490     return $ foldr WithBlock o rs
   491     
   491     
   492 repeatCycle = do
   492 repeatCycle = do
   493     try $ string "repeat"
   493     try $ string "repeat"
   494     comments
   494     comments
   495     o <- many phrase
   495     o <- many phrase