Commit Graph

60 Commits

Author SHA1 Message Date
Danny Navarro
ec018db73a Handle comments in whitespace 2015-09-14 15:43:09 +02:00
Danny Navarro
26e2372c5e Fix value parsing
- Add missing variable parsing.
- Reuse `name` in value string.

This parses successfully the `kitchen-sink.graphql` sample from
`graphql-js`.
2015-09-14 14:14:25 +02:00
Danny Navarro
c0b6fc8a05 Replace take... functions with many...
They are less efficient but they are giving me issues because they don't
fail. Once this is working I'll look into optimizing.

Also disable skipping comments until I figure out how to skip both
comments and space at the same time.
2015-09-14 13:16:58 +02:00
Danny Navarro
62adfd89cd Several improvements to the parser
- Add token combinator to simplify whitespace handling.
- Simplify whiteSpace parsers.
- Add `optempty` to handle pure mempty cases. `empty /= pure mempty`.
- Use `between` combinators for brackets, braces and parens.

This also includes small adjustments to the AST.
2015-09-14 12:15:04 +02:00
Danny Navarro
b206079047 Add missing = required default values and unions 2015-09-13 17:44:31 +02:00
Danny Navarro
048ee552d8 Take care of comments 2015-09-13 15:34:01 +02:00
Danny Navarro
0e67fdc21c Add GraphQL parser
WIP: This parser just type checks, it hasn't even been tested manually.
Check new tasks in the TODO file and the TODO comments in the code for
more gotchas.
2015-09-13 13:55:15 +02:00
Danny Navarro
44a2ff4765 Minor adjustments in AST for easier parsing
Also `Maybe` wrappers removed. I don't think there needs to be a special
case for empty values vs no values at all.
2015-09-13 13:49:11 +02:00
Danny Navarro
97b99eb448 Add missing OperationDefinition Name 2015-09-12 15:44:30 +02:00
Danny Navarro
0f673b9b4d Rename module Data.GraphQL -> Data.GraphQL.AST 2015-09-12 15:16:28 +02:00