Add missing = required default values and unions

This commit is contained in:
Danny Navarro 2015-09-13 17:44:31 +02:00
parent 048ee552d8
commit b206079047

View File

@ -73,7 +73,10 @@ variableDefinition :: Parser VariableDefinition
variableDefinition =
VariableDefinition <$> variable <* s <* ":" <* s
<*> type_ <* s
<*> value
<*> (defaultValue <|> empty)
defaultValue :: Parser DefaultValue
defaultValue = "=" *> s *> value
-- In defense of good taste, I'm taking liberty of not allowing space between
-- '$' and the 'name' even though that's not in the spec.
@ -248,6 +251,7 @@ unionTypeDefinition :: Parser UnionTypeDefinition
unionTypeDefinition = UnionTypeDefinition
<$ "union" <* s1
<*> name <* s
<* "=" <* s
<*> unionMembers
where
-- This should take care of standalone `NamedType`