Commit 1f0537d4 authored by Hans-Peter Deifel's avatar Hans-Peter Deifel
Browse files

prism-converter: Allow arbitrary strings as variable values

States files can now not only contain numbers as potential values for
variables but also arbitrary strings which includes e.g `true` and
`false`.
parent 45d11363
......@@ -30,7 +30,9 @@ import Parser
-- Types
----------------------------------------------------------------------
data Value = Number Int
data Value
= Number Int
| String Text
deriving (Eq, Ord)
data StatesFile = StatesFile
......@@ -57,7 +59,7 @@ stateP =
(decimalP *> symbolP ":" *> parens (valueP `sepBy` symbolP ","))
valueP :: Parser Value
valueP = Number <$> decimalP
valueP = (Number <$> decimalP) <|> (String <$> nameP)
parens :: Parser a -> Parser a
parens = between (symbolP "(") (symbolP ")")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment