UNPKG

codemirror-graphql

Version:
17 lines 696 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = runParser; const graphql_language_service_1 = require("graphql-language-service"); function runParser(sourceText, parserOptions, callbackFn) { const parser = (0, graphql_language_service_1.onlineParser)(parserOptions); const state = parser.startState(); const lines = sourceText.split('\n'); for (const line of lines) { const stream = new graphql_language_service_1.CharacterStream(line); while (!stream.eol()) { const style = parser.token(stream, state); callbackFn(stream, state, style); } } } //# sourceMappingURL=runParser.js.map