Skip to content

Commit 4abde6e

Browse files
calebmerwincent
authored andcommitted
Fix GitHub syntax highlighting (#753)
1 parent c87fbd7 commit 4abde6e

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

src/language/ast.js

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,32 @@ export type Location = {
4343
source: Source;
4444
};
4545

46+
/**
47+
* Represents the different kinds of tokens in a GraphQL document.
48+
* This type is not inlined in `Token` to fix syntax highlighting on GitHub
49+
* *only*.
50+
*/
51+
type TokenKind = '<SOF>'
52+
| '<EOF>'
53+
| '!'
54+
| '$'
55+
| '('
56+
| ')'
57+
| '...'
58+
| ':'
59+
| '='
60+
| '@'
61+
| '['
62+
| ']'
63+
| '{'
64+
| '|'
65+
| '}'
66+
| 'Name'
67+
| 'Int'
68+
| 'Float'
69+
| 'String'
70+
| 'Comment';
71+
4672
/**
4773
* Represents a range of characters represented by a lexical token
4874
* within a Source.
@@ -52,26 +78,7 @@ export type Token = {
5278
/**
5379
* The kind of Token.
5480
*/
55-
kind: '<SOF>'
56-
| '<EOF>'
57-
| '!'
58-
| '$'
59-
| '('
60-
| ')'
61-
| '...'
62-
| ':'
63-
| '='
64-
| '@'
65-
| '['
66-
| ']'
67-
| '{'
68-
| '|'
69-
| '}'
70-
| 'Name'
71-
| 'Int'
72-
| 'Float'
73-
| 'String'
74-
| 'Comment';
81+
kind: TokenKind;
7582

7683
/**
7784
* The character offset at which this Node begins.

0 commit comments

Comments
 (0)