WIP: GraphQL first shot

This commit is contained in:
Pavel Lang 2018-11-21 04:30:46 +01:00
parent 8f7537dee5
commit f0df74079c
No known key found for this signature in database
GPG key ID: 623A223A57974B55
5 changed files with 199 additions and 0 deletions

View file

@ -0,0 +1,42 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { testTokenization } from '../test/testRunner';
testTokenization('graphql', [
// Keywords
[{
line: 'scalar Date',
tokens: [
{ startIndex: 0, type: 'keyword.gql' },
{ startIndex: 6, type: '' },
{ startIndex: 7, type: 'type.identifier.gql' },
]
}],
// Root schema definition
[{
line: 'schema { query: Query }',
tokens: [
{ startIndex: 0, type: "keyword.gql" },
{ startIndex: 6, type: "" },
{ startIndex: 7, type: "delimiter.curly.gql" },
{ startIndex: 8, type: "" },
{ startIndex: 9, type: "keyword.gql" }, // this should be identifier!
{ startIndex: 14, type: "delimiter.gql" },
{ startIndex: 15, type: "" },
{ startIndex: 16, type: "type.identifier.gql" },
{ startIndex: 21, type: "" },
{ startIndex: 22, type: "delimiter.curly.gql" },
]
}],
// Comments - single line
// Comments - range comment, single line
]);