Made set line parsing more specific

This commit is contained in:
Correl Roush 2012-03-05 20:02:12 -05:00
parent db9148a76b
commit 8596c81c62

View file

@ -87,12 +87,12 @@ stats_line = do
sets_line :: Parser [(String, Rarity)] sets_line :: Parser [(String, Rarity)]
sets_line = do sets_line = do
sets <- sepBy set (string ", ") sets <- sepBy1 set (string ", ")
return sets return sets
set :: Parser (String, Rarity) set :: Parser (String, Rarity)
set = do set = do
set' <- many1 (noneOf "\n-") set' <- many1 $ oneOf $ ['A'..'Z'] ++ ['0'..'9']
char '-' char '-'
rarity' <- oneOf "LCURMS" rarity' <- oneOf "LCURMS"
case rarity' of case rarity' of