Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lexers/embedded/graphql.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
</config>
<rules>
<state name="root">
<rule words="query mutation subscription fragment scalar implements interface union enum input type">
<rule words="query mutation subscription fragment scalar implements interface union enum input type" suffix="\b">
<token type="KeywordDeclaration"/>
<push state="type"/>
</rule>
<rule words="on extend schema directive ...">
<rule words="on extend schema directive" suffix="\b">
<token type="KeywordDeclaration"/>
</rule>
<rule pattern="\.\.\.">
<token type="KeywordDeclaration"/>
</rule>
<rule words="QUERY MUTATION SUBSCRIPTION FIELD FRAGMENT_DEFINITION FRAGMENT_SPREAD INLINE_FRAGMENT SCHEMA SCALAR OBJECT FIELD_DEFINITION ARGUMENT_DEFINITION INTERFACE UNION ENUM ENUM_VALUE INPUT_OBJECT INPUT_FIELD_DEFINITION" suffix="\b">
Expand Down
2 changes: 2 additions & 0 deletions lexers/testdata/graphql.actual
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ directive @deprecated(
scalar A
"""A delimiter: \""" inside."""
scalar B
query { typeName online ...Details }
fragment Details on Query { id }
27 changes: 27 additions & 0 deletions lexers/testdata/graphql.expected
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,32 @@
{"type":"KeywordDeclaration","value":"scalar"},
{"type":"TextWhitespace","value":" "},
{"type":"NameClass","value":"B"},
{"type":"TextWhitespace","value":"\n"},
{"type":"KeywordDeclaration","value":"query"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"TextWhitespace","value":" "},
{"type":"NameProperty","value":"typeName"},
{"type":"TextWhitespace","value":" "},
{"type":"NameProperty","value":"online"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"..."},
{"type":"NameProperty","value":"Details"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n"},
{"type":"KeywordDeclaration","value":"fragment"},
{"type":"TextWhitespace","value":" "},
{"type":"NameClass","value":"Details"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordDeclaration","value":"on"},
{"type":"TextWhitespace","value":" "},
{"type":"NameProperty","value":"Query"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"TextWhitespace","value":" "},
{"type":"NameProperty","value":"id"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n"}
]