Skip to content

Commit a12f6df

Browse files
committed
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`.
1 parent 5c6e700 commit a12f6df

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

Section 8 -- Grammar.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,24 @@ Example_param :
6868
- C_param
6969
- D
7070

71+
A grammar production may specify that certain expansions are not permitted by
72+
using the phrase "but not" and then indicating the expansions to be excluded.
73+
74+
For example, the production:
75+
76+
SafeName : Name but not SevenCarlinWords
77+
78+
means that the nonterminal {SafeName} may be replaced by any sequence of
79+
characters that could replace {Name} provided that the same sequence of
80+
characters could not replace {SevenCarlinWords}.
81+
82+
A grammar may also list a number of restrictions after "but not" seperated
83+
by "or".
84+
85+
For example:
86+
87+
NonBooleanName : Name but not `true` or `false`
88+
7189

7290
## Ignored Source
7391

@@ -247,7 +265,7 @@ InlineFragment : ... on TypeCondition Directives? SelectionSet
247265

248266
FragmentDefinition : fragment FragmentName on TypeCondition Directives? SelectionSet
249267

250-
FragmentName : [ lookahead ! on ] Name
268+
FragmentName : Name but not `on`
251269

252270
TypeCondition : TypeName
253271

@@ -271,7 +289,7 @@ BooleanValue :
271289
- true
272290
- false
273291

274-
EnumValue : Name
292+
EnumValue : Name but not `true`, `false` or `null`
275293

276294

277295
#### Array Value

0 commit comments

Comments
 (0)