From a12f6df77772cc4c86b69e01d9e4ea7addb09dce Mon Sep 17 00:00:00 2001 From: Lee Byron Date: Thu, 16 Jul 2015 12:45:35 -0700 Subject: [PATCH] Add constraints to `EnumValue` This changes the formatting for constraints to be a little easier to read IMO. Also, adds the disambiguating constraints to `EnumValue`. --- Section 8 -- Grammar.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Section 8 -- Grammar.md b/Section 8 -- Grammar.md index 7b7aea944..7839f4a96 100644 --- a/Section 8 -- Grammar.md +++ b/Section 8 -- Grammar.md @@ -68,6 +68,24 @@ Example_param : - C_param - D +A grammar production may specify that certain expansions are not permitted by +using the phrase "but not" and then indicating the expansions to be excluded. + +For example, the production: + +SafeName : Name but not SevenCarlinWords + +means that the nonterminal {SafeName} may be replaced by any sequence of +characters that could replace {Name} provided that the same sequence of +characters could not replace {SevenCarlinWords}. + +A grammar may also list a number of restrictions after "but not" seperated +by "or". + +For example: + +NonBooleanName : Name but not `true` or `false` + ## Ignored Source @@ -247,7 +265,7 @@ InlineFragment : ... on TypeCondition Directives? SelectionSet FragmentDefinition : fragment FragmentName on TypeCondition Directives? SelectionSet -FragmentName : [ lookahead ! on ] Name +FragmentName : Name but not `on` TypeCondition : TypeName @@ -271,7 +289,7 @@ BooleanValue : - true - false -EnumValue : Name +EnumValue : Name but not `true`, `false` or `null` #### Array Value