Skip to content

Commit f331650

Browse files
authored
Clarify how lexical tokens are separated (#748)
1 parent 7546566 commit f331650

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

spec/Section 2 -- Language.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ LineTerminator ::
9898
- "Carriage Return (U+000D)" "New Line (U+000A)"
9999

100100
Like white space, line terminators are used to improve the legibility of source
101-
text, any amount may appear before or after any other token and have no
102-
significance to the semantic meaning of a GraphQL Document. Line
103-
terminators are not found within any other token.
101+
text and separate lexical tokens, any amount may appear before or after any
102+
other token and have no significance to the semantic meaning of a GraphQL
103+
Document. Line terminators are not found within any other token.
104104

105105
Note: Any error reporting which provides the line number in the source of the
106106
offending syntax should use the preceding amount of {LineTerminator} to produce
@@ -137,7 +137,7 @@ syntactically and semantically insignificant within GraphQL Documents.
137137
Non-significant comma characters ensure that the absence or presence of a comma
138138
does not meaningfully alter the interpreted syntax of the document, as this can
139139
be a common user-error in other languages. It also allows for the stylistic use
140-
of either trailing commas or line-terminators as list delimiters which are both
140+
of either trailing commas or line terminators as list delimiters which are both
141141
often desired for legibility and maintainability of source code.
142142

143143

@@ -151,7 +151,8 @@ Token ::
151151
- StringValue
152152

153153
A GraphQL document is comprised of several kinds of indivisible lexical tokens
154-
defined here in a lexical grammar by patterns of source Unicode characters.
154+
defined here in a lexical grammar by patterns of source Unicode characters.
155+
Lexical tokens may be separated by {Ignored} tokens.
155156

156157
Tokens are later used as terminal symbols in GraphQL syntactic grammar rules.
157158

@@ -166,8 +167,8 @@ Ignored ::
166167
- Comma
167168

168169
{Ignored} tokens are used to improve readability and provide separation between
169-
{Token}, but are otherwise insignificant and not referenced in syntactical
170-
grammar productions.
170+
lexical tokens, but are otherwise insignificant and not referenced in
171+
syntactical grammar productions.
171172

172173
Any amount of {Ignored} may appear before and after every lexical token. No
173174
ignored regions of a source document are significant, however {SourceCharacter}

0 commit comments

Comments
 (0)