From 88ca3d18664aa5fd64692491086b07876c5facae Mon Sep 17 00:00:00 2001 From: Danny Navarro Date: Mon, 21 Sep 2015 09:28:51 +0200 Subject: [PATCH] Add errors for all parser `Alternative`s --- Data/GraphQL/Parser.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Data/GraphQL/Parser.hs b/Data/GraphQL/Parser.hs index 09190b0..8f8e185 100644 --- a/Data/GraphQL/Parser.hs +++ b/Data/GraphQL/Parser.hs @@ -163,6 +163,7 @@ value = ValueVariable <$> variable <|> ValueEnum <$> name <|> ValueList <$> listValue <|> ValueObject <$> objectValue + "value error!" stringValue :: Parser StringValue @@ -207,6 +208,7 @@ type_ :: Parser Type type_ = TypeNamed <$> namedType <|> TypeList <$> listType <|> TypeNonNull <$> nonNullType + "type_ error!" namedType :: Parser NamedType namedType = NamedType <$> name @@ -217,6 +219,7 @@ listType = ListType <$> brackets type_ nonNullType :: Parser NonNullType nonNullType = NonNullTypeNamed <$> namedType <* tok "!" <|> NonNullTypeList <$> listType <* tok "!" + "nonNullType error!" -- * Type Definition @@ -237,7 +240,6 @@ objectTypeDefinition = ObjectTypeDefinition <*> name <*> optempty interfaces <*> fieldDefinitions - "objectTypeDefinition error!" interfaces :: Parser Interfaces interfaces = tok "implements" *> many1 namedType