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/Main.hs

    r3 r6  
    164164          | ParamN (Maybe Int)     -- ^ Specify $n$ parameter. 
    165165          | ParamT (Maybe Chomp)   -- ^ Specify $t$ parameter. 
    166           | ParamS (Maybe Style)   -- ^ Specify $s$ parameter. 
    167166          | ParamC (Maybe Context) -- ^ Specify $c$ parameter. 
    168167          | Input String           -- ^ Specify input file name. 
     
    193192             (ReqArg (ParamC . readParameter) "context") 
    194193             "c parameter value (context)", 
    195       Option ['s'] ["style"] 
    196              (ReqArg (ParamS . readParameter) "style") 
    197              "s parameter value (style)", 
    198194      Option ['t'] ["chomp"] 
    199195             (ReqArg (ParamT . readParameter) "chomp") 
     
    230226      oN             :: Maybe Int,     -- ^ N parameter, if any. 
    231227      oC             :: Maybe Context, -- ^ C parameter, if any. 
    232       oS             :: Maybe Style,   -- ^ S parameter, if any. 
    233228      oT             :: Maybe Chomp    -- ^ T parameter, if any. 
    234229  } 
     
    244239      oN             = Nothing, 
    245240      oC             = Nothing, 
    246       oS             = Nothing, 
    247241      oT             = Nothing 
    248242  } 
     
    260254       ParamN value    -> applyFlags flags options { oN = value } 
    261255       ParamC value    -> applyFlags flags options { oC = value } 
    262        ParamS value    -> applyFlags flags options { oS = value } 
    263256       ParamT value    -> applyFlags flags options { oT = value } 
    264257       Production name -> applyFlags flags options { oProduction = name } 
     
    283276runWith :: Options -> IO () 
    284277runWith options = 
    285   do let resolved = case ((oN options), (oC options), (oS options), (oT options)) of 
    286                          (Nothing,    Nothing,    Nothing,    Nothing) -> tokenizer       (oProduction options) 
    287                          (Just n,     Nothing,    Nothing,    Nothing) -> tokenizerWithN  (oProduction options) n 
    288                          (Nothing,    Just c,     Nothing,    Nothing) -> tokenizerWithC  (oProduction options) c 
    289                          (Nothing,    Nothing,    Just s,     Nothing) -> tokenizerWithS  (oProduction options) s 
    290                          (Nothing,    Nothing,    Nothing,    Just t)  -> tokenizerWithT  (oProduction options) t 
    291                          (Just n,     Just c,     Nothing,    Nothing) -> tokenizerWithNC (oProduction options) n c 
    292                          (Just n,     Nothing,    Just s,     Nothing) -> tokenizerWithNS (oProduction options) n s 
    293                          (Just n,     Nothing,    Nothing,    Just t)  -> tokenizerWithNT (oProduction options) n t 
    294                          _                                             -> error "No production with this combination of parameters" 
     278  do let resolved = case ((oN options), (oC options), (oT options)) of 
     279                         (Nothing,    Nothing,    Nothing) -> tokenizer       (oProduction options) 
     280                         (Just n,     Nothing,    Nothing) -> tokenizerWithN  (oProduction options) n 
     281                         (Nothing,    Just c,     Nothing) -> tokenizerWithC  (oProduction options) c 
     282                         (Nothing,    Nothing,    Just t)  -> tokenizerWithT  (oProduction options) t 
     283                         (Just n,     Just c,     Nothing) -> tokenizerWithNC (oProduction options) n c 
     284                         (Just n,     Nothing,    Just t)  -> tokenizerWithNT (oProduction options) n t 
     285                         _                                 -> error "No production with this combination of parameters" 
    295286     case resolved of 
    296287          Nothing     -> error $ "No production " ++ (oProduction options) ++ " or it doesn't take this combination of parameters"