Show
Ignore:
Timestamp:
04/06/08 04:24:28 (9 months ago)
Author:
oren
Message:

Version 0.9 - compatible with the April 06, 2008 draft.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/YamlReference/yaml2yeast-test/Main.hs

    r3 r6  
    7575              | WithN  -- ^ Production requiring $n$ argument. 
    7676              | WithC  -- ^ Production requiring $c$ argument. 
    77               | WithS  -- ^ Production requiring $s$ argument. 
    7877              | WithT  -- ^ Production requiring $t$ argument. 
    7978              | WithNC -- ^ Production requiring $n$ and $c$ arguments. 
    80               | WithNS -- ^ Production requiring $n$ and $s$ arguments. 
    8179              | WithNT -- ^ Production requiring $n$ and $t$ arguments. 
    8280  deriving Eq 
     
    9088           WithN  -> " n" 
    9189           WithC  -> " c" 
    92            WithS  -> " s" 
    9390           WithT  -> " t" 
    9491           WithNC -> " n c" 
    95            WithNS -> " n s" 
    9692           WithNT -> " n t" 
    9793 
     
    118114testType file = do withN <- isWith "n" file 
    119115                   withC <- isWith "c" file 
    120                    withS <- isWith "s" file 
    121116                   withT <- isWith "t" file 
    122                    case (withN, withC, withS, withT) of 
    123                         (False, False, False, False) -> return Plain 
    124                         (True,  False, False, False) -> return WithN 
    125                         (False, False, True,  False) -> return WithS 
    126                         (False, True,  False, False) -> return WithC 
    127                         (False, False, False, True)  -> return WithT 
    128                         (True,  True,  False, False) -> return WithNC 
    129                         (True,  False, True,  False) -> return WithNS 
    130                         (True,  False, False, True)  -> return WithNT 
    131                         (_,     _,     _,     _)     -> error $ file ++ ": unknown parameters combination" 
     117                   case (withN, withC, withT) of 
     118                        (False, False, False) -> return Plain 
     119                        (True,  False, False) -> return WithN 
     120                        (False, True,  False) -> return WithC 
     121                        (False, False, True)  -> return WithT 
     122                        (True,  True,  False) -> return WithNC 
     123                        (True,  False, True)  -> return WithNT 
     124                        (_,     _,     _)     -> error $ file ++ ": unknown parameters combination" 
    132125 
    133126-- | @testProduction file@ extracts the production name from a test input 
     
    178171                       WithN  -> tokenizerWithN (testProduction inputFile)  (testParameter "n" inputFile) 
    179172                       WithC  -> tokenizerWithC (testProduction inputFile)  (testParameter "c" inputFile) 
    180                        WithS  -> tokenizerWithS (testProduction inputFile)  (testParameter "s" inputFile) 
    181173                       WithT  -> tokenizerWithT (testProduction inputFile)  (testParameter "t" inputFile) 
    182174                       WithNC -> tokenizerWithNC (testProduction inputFile) (testParameter "n" inputFile) (testParameter "c" inputFile) 
    183                        WithNS -> tokenizerWithNS (testProduction inputFile) (testParameter "n" inputFile) (testParameter "s" inputFile) 
    184175                       WithNT -> tokenizerWithNT (testProduction inputFile) (testParameter "n" inputFile) (testParameter "t" inputFile) 
    185176     case result of