@kurrawongai/codemirror-lang-turtle12 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/dist/index.cjs +33 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +33 -5
- package/dist/index.js.map +1 -1
- package/dist/lint.d.ts +16 -0
- package/package.json +2 -1
- package/src/index.ts +6 -2
- package/src/lint.ts +53 -0
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
RDF 1.2 Turtle, TriG, N-Triples, and N-Quads support for CodeMirror 6.
|
|
4
4
|
|
|
5
|
+
The RDF 1.2 specifications targeted by this package are W3C Working Drafts,
|
|
6
|
+
not final Recommendations. Their syntax may change; see the project's
|
|
7
|
+
[standards status](https://github.com/kurrawong/codemirror-lang-rdf#standards-status).
|
|
8
|
+
|
|
5
9
|
## Get started
|
|
6
10
|
|
|
7
11
|
```sh
|
|
@@ -25,8 +29,8 @@ Use `trig()`, `ntriples()`, or `nquads()` from the same package for those
|
|
|
25
29
|
formats. Turtle and TriG include prefix completion; N-Triples and N-Quads do
|
|
26
30
|
not include a completion source.
|
|
27
31
|
|
|
28
|
-
The parser supports editing incomplete documents
|
|
29
|
-
to check document validity.
|
|
32
|
+
The parser supports editing incomplete documents, and the editor underlines
|
|
33
|
+
parse errors. Use a separate validator to check document validity.
|
|
30
34
|
|
|
31
35
|
## Documentation
|
|
32
36
|
|
package/dist/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var language = require('@codemirror/language');
|
|
4
4
|
var lr = require('@lezer/lr');
|
|
5
5
|
var highlight = require('@lezer/highlight');
|
|
6
|
+
var lint = require('@codemirror/lint');
|
|
6
7
|
|
|
7
8
|
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
8
9
|
const parser$1 = lr.LRParser.deserialize({
|
|
@@ -156,6 +157,32 @@ function turtleCompletionSource(options = {}, dialect = "turtle") {
|
|
|
156
157
|
};
|
|
157
158
|
}
|
|
158
159
|
|
|
160
|
+
const PARSE_TIMEOUT_MS = 1e3;
|
|
161
|
+
const GAP = /^(?:\s|#.*)*$/;
|
|
162
|
+
function parseErrors(state) {
|
|
163
|
+
const tree = language.ensureSyntaxTree(state, state.doc.length, PARSE_TIMEOUT_MS);
|
|
164
|
+
if (!tree) return [];
|
|
165
|
+
const runs = [];
|
|
166
|
+
tree.iterate({
|
|
167
|
+
enter: (node) => {
|
|
168
|
+
if (!node.type.isError) return;
|
|
169
|
+
const last = runs[runs.length - 1];
|
|
170
|
+
if (last && (node.from <= last.to || GAP.test(state.sliceDoc(last.to, node.from))))
|
|
171
|
+
last.to = Math.max(last.to, node.to);
|
|
172
|
+
else runs.push({ from: node.from, to: node.to });
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
return runs.map(({ from, to }) => ({ from, to, message: errorMessage(state.sliceDoc(from, to)) }));
|
|
176
|
+
}
|
|
177
|
+
function errorMessage(text) {
|
|
178
|
+
const shown = text.replace(/\s+/g, " ").trim();
|
|
179
|
+
if (!shown) return "Syntax error.";
|
|
180
|
+
return `Unexpected \u201C${shown.length > 32 ? `${shown.slice(0, 32)}\u2026` : shown}\u201D.`;
|
|
181
|
+
}
|
|
182
|
+
function parseErrorLinter() {
|
|
183
|
+
return lint.linter((view) => parseErrors(view.state).map((error) => ({ ...error, severity: "error" })));
|
|
184
|
+
}
|
|
185
|
+
|
|
159
186
|
const parser = parser$1;
|
|
160
187
|
const statementFold = (node, state) => {
|
|
161
188
|
const firstLineEnd = state.doc.lineAt(node.from).to;
|
|
@@ -202,7 +229,8 @@ const ntriplesLanguage = define("NTriplesDoc");
|
|
|
202
229
|
const nquadsLanguage = define("NQuadsDoc");
|
|
203
230
|
function support(language$1, options, dialect) {
|
|
204
231
|
return new language.LanguageSupport(language$1, [
|
|
205
|
-
language$1.data.of({ autocomplete: turtleCompletionSource(options, dialect) })
|
|
232
|
+
language$1.data.of({ autocomplete: turtleCompletionSource(options, dialect) }),
|
|
233
|
+
parseErrorLinter()
|
|
206
234
|
]);
|
|
207
235
|
}
|
|
208
236
|
function turtle(options = {}) {
|
|
@@ -212,10 +240,10 @@ function trig(options = {}) {
|
|
|
212
240
|
return support(trigLanguage, options, "trig");
|
|
213
241
|
}
|
|
214
242
|
function ntriples() {
|
|
215
|
-
return new language.LanguageSupport(ntriplesLanguage);
|
|
243
|
+
return new language.LanguageSupport(ntriplesLanguage, parseErrorLinter());
|
|
216
244
|
}
|
|
217
245
|
function nquads() {
|
|
218
|
-
return new language.LanguageSupport(nquadsLanguage);
|
|
246
|
+
return new language.LanguageSupport(nquadsLanguage, parseErrorLinter());
|
|
219
247
|
}
|
|
220
248
|
|
|
221
249
|
exports.documentPrefixes = documentPrefixes;
|
|
@@ -224,6 +252,8 @@ exports.nquads = nquads;
|
|
|
224
252
|
exports.nquadsLanguage = nquadsLanguage;
|
|
225
253
|
exports.ntriples = ntriples;
|
|
226
254
|
exports.ntriplesLanguage = ntriplesLanguage;
|
|
255
|
+
exports.parseErrorLinter = parseErrorLinter;
|
|
256
|
+
exports.parseErrors = parseErrors;
|
|
227
257
|
exports.parser = parser;
|
|
228
258
|
exports.trig = trig;
|
|
229
259
|
exports.trigLanguage = trigLanguage;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/turtle.grammar","../src/highlight.ts","../src/complete.ts","../src/index.ts"],"sourcesContent":["// This file was generated by lezer-generator. You probably shouldn't edit it.\nimport {LRParser} from \"@lezer/lr\"\nexport const parser = LRParser.deserialize({\n version: 14,\n states: \"5fQYQPOOQ!WQPOOQ!bQPOOQ!bQPOOOOQO'#Ce'#CeOOQO'#EX'#EXO!jQPO'#CaO!oQPO'#CgO!zQPO'#CiO!oQPO'#CkO#PQPO'#CmO#UQPO'#CmOOQO'#C_'#C_OOQO'#Cv'#Cv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$U#y$_R$b$YWaOfh#PUgPiq`!X^!Q![#b#y$Y$Z$_Q!]`Q!w!WQ#g!|Q#q#]V#s#^#i#{WaOfh#PSmPqa!X^!Q![#b#y$Y$Z$_WbOfh#PSlPqa!X^!Q![#b#y$Y$Z$_d!V^!Q![!|#]#b#y$Y$Z$_V#V!l!n$PV!v!S!}#Ue!V^!Q![!|#]#b#y$Y$Z$_`!X^!Q![#b#y$Y$Z$_Q#g!|R#q#]WbOfh#PSkPq`!X^!Q![#b#y$Y$Z$_Q!]`R#g!|[#`!z#O#a#j#v$OR#}#hQ#d!zS$T#v$OR$]#O]#`!z#O#a#j#v$OTnPqSjPqR!eiSnPqQ!fjR#R!eQ!dhR#k#PTsQtTvRwR#p#YQfOR!afQ!Q^R!s!QS#a!z#vS#j#O$OT#u#a#jQ#c!zW#w#c#x$[$^Q#x#dQ$[#OR$^$]Q#f!{S#z#f$aR$a$bQqPR!jqQtQR!ktQwRR!mwTeOfWaOfh#PUgPiqQzVQ|X`!X^!Q![#b#y$Y$Z$_h!Y_abjklm!^!x#_#e$`Q!]`Q!luQ!nxQ!oyQ!q{Q!w!WQ#[!uQ#g!|Q#q#]V#s#^#i#{S!P^!QS!z![#yS#O$Y$_Q#v#bR$O$ZR!x!WR#r#]R!^`R#h!|TpPqQ#X!lQ#Y!nR$W$PSuQtSxRwR#l#W\",\n nodeNames: \"⚠ Comment TurtleDoc Directive . PrefixID AtPrefix PNameNS IRIRef PrefixedName PNameLN Base AtBase SparqlPrefix KwPrefix SparqlBase KwBase Version KwVersion VersionSpecifier AtVersion Triples PredicateObjectList Verb KeywordA ObjectList BlankNode BlankNodeLabel Anon ) ( Collection ] [ BlankNodePropertyList RDFLiteral String LangDir Datatype ^^ NumericLiteral Integer Decimal Double BooleanLiteral True False )>> <<( TripleTerm >> << ReifiedTriple Reifier ~ Annotation |} {| AnnotationBlock , ; TrigDoc GraphStatement KwGraph LabelOrSubject } { WrappedGraph TriplesBlock TriplesOrGraph Triples2 NTriplesD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\":[0,2],\"TrigDoc\":[1,61],\"NTriplesDoc\":[2,71],\"NQuadsDoc\":[3,74]},\n tokenPrec: 931\n})\n","import type { NodePropSource } from '@lezer/common';\nimport { styleTags, tags as t } from '@lezer/highlight';\n\n/**\n * The shared highlight-tag table, Turtle half.\n *\n * `docs/highlight-tags.md` is the canonical table and `test/highlight.test.ts`\n * asserts this against it, so a consumer can keep one `HighlightStyle` for all\n * three languages. Two conventions are worth knowing:\n *\n * - an IRI and a prefixed name are tagged differently (`url` / `namespace`)\n * but denote the same kind of thing, so a style is free to colour them the\n * same — which is what the reference style does;\n * - a datatype IRI is tagged `typeName` rather than `url`, because it\n * qualifies the literal rather than being a term the document is about. The\n * parent-path rules below are more specific than the bare token rules, so\n * they win inside `Datatype`.\n */\nexport const turtleHighlighting: NodePropSource = styleTags({\n Comment: t.comment,\n\n 'AtPrefix AtBase AtVersion KwPrefix KwBase KwGraph KwVersion KeywordA': t.keyword,\n\n IRIRef: t.url,\n 'PNameNS PNameLN': t.namespace,\n\n 'BlankNodeLabel Anon': t.propertyName,\n\n 'String VersionSpecifier': t.string,\n 'Integer Decimal Double': t.number,\n 'True False': t.bool,\n\n LangDir: t.annotation,\n 'Datatype/IRIRef Datatype/PrefixedName/PNameNS Datatype/PrefixedName/PNameLN': t.typeName,\n 'Datatype/\"^^\"': t.typeName,\n\n /*\n * The RDF 1.2 term brackets are tagged apart from ordinary grouping, because\n * `<< s p o >>` and `<<( s p o )>>` differ by one character and mean quite\n * different things — a statement you can refer to, versus an object that *is*\n * a triple. A style that cannot separate them cannot help a reader see that.\n *\n * Each is a `special()` of the standard tag its glyphs actually are, so the\n * fallback chain does the work: a theme that knows nothing about RDF 1.2 and\n * styles `bracket` (or `brace`/`paren`/`angleBracket`) still colours all of\n * them, and one that wants the distinction overrides the specific tag.\n */\n\n /*\n * Every token *inside* an RDF 1.2 nested-triple construct also carries\n * `quote`, so a style can shade the whole thing and not just its brackets —\n * which is what \"colour reified triples differently\" usually means. The\n * `/...` form applies to descendants and *combines* with each token's own\n * tag, so an IRI inside a reified triple is `quote url`, not one or the\n * other. A style that never mentions `quote` sees no change at all.\n *\n * One tag for all three constructs, rather than three: the brackets above\n * already say which kind it is, and a style wanting per-kind regions can add\n * its own props to the exported parser.\n */\n 'ReifiedTriple/... TripleTerm/... NTripleTerm/... AnnotationBlock/...': t.quote,\n\n '\"<<\" \">>\"': t.special(t.angleBracket),\n '\"<<(\" \")>>\"': t.special(t.paren),\n '\"{|\" \"|}\"': t.special(t.brace),\n '\"{\" \"}\"': t.brace,\n '\"[\" \"]\"': t.squareBracket,\n '\"(\" \")\"': t.paren,\n\n // The reifier marker only ever introduces a reifier, so it is worth telling\n // from arithmetic; it falls back to `operator`.\n '\"~\"': t.special(t.operator),\n\n '\";\" \",\"': t.separator,\n '\".\"': t.punctuation,\n});\n","import { syntaxTree } from '@codemirror/language';\nimport type { Completion, CompletionContext, CompletionResult } from '@codemirror/autocomplete';\nimport type { EditorState } from '@codemirror/state';\n\n/** A prefix label (without the colon) mapped to the IRI it expands to. */\nexport type PrefixMap = Record<string, string>;\n\n/** Where `turtle()` and friends may look for prefixes beyond the document. */\nexport type PrefixSource = PrefixMap | ((state: EditorState) => PrefixMap);\n\nexport interface CompletionOptions {\n /**\n * Prefixes the editor should offer even when the document has not declared\n * them — an application's own prefix manager, typically. Document\n * declarations win on conflict, because what the document says is what the\n * document means.\n */\n prefixSource?: PrefixSource;\n}\n\nconst DIRECTIVES = ['@prefix', '@base', 'PREFIX', 'BASE'];\nconst TRIG_DIRECTIVES = [...DIRECTIVES, 'GRAPH'];\nconst TERM_KEYWORDS = ['a', 'true', 'false'];\n\n/** Nodes whose interior is text, not syntax: no completion belongs there. */\nconst INERT = new Set(['Comment', 'String', 'VersionSpecifier', 'IRIRef']);\n\n/**\n * The prefixes declared by the document itself, read from the syntax tree.\n *\n * Both spellings are read — `@prefix ex: <…>` and `PREFIX ex: <…>` — because a\n * document may mix them, and a reader completing `ex:` does not care which one\n * declared it.\n */\nexport function documentPrefixes(state: EditorState): PrefixMap {\n const prefixes: PrefixMap = {};\n const tree = syntaxTree(state);\n tree.iterate({\n enter: (node) => {\n if (node.name !== 'PrefixID' && node.name !== 'SparqlPrefix') return;\n let label: string | null = null;\n let iri: string | null = null;\n for (let child = node.node.firstChild; child; child = child.nextSibling) {\n if (child.name === 'PNameNS' && label === null) {\n label = state.sliceDoc(child.from, child.to).slice(0, -1);\n } else if (child.name === 'IRIRef' && iri === null) {\n iri = state.sliceDoc(child.from + 1, child.to - 1);\n }\n }\n if (label !== null) prefixes[label] = iri ?? '';\n },\n });\n return prefixes;\n}\n\nfunction resolveSource(source: PrefixSource | undefined, state: EditorState): PrefixMap {\n if (!source) return {};\n return typeof source === 'function' ? source(state) : source;\n}\n\n/** Every prefix the editor knows about: the external source, overlaid by the document's. */\nexport function knownPrefixes(state: EditorState, options: CompletionOptions = {}): PrefixMap {\n return { ...resolveSource(options.prefixSource, state), ...documentPrefixes(state) };\n}\n\nfunction prefixCompletions(state: EditorState, options: CompletionOptions): Completion[] {\n const prefixes = knownPrefixes(state, options);\n return Object.entries(prefixes).map(([label, iri]) => ({\n label: `${label}:`,\n type: 'namespace',\n detail: iri || undefined,\n }));\n}\n\nfunction keywordCompletions(words: readonly string[]): Completion[] {\n return words.map((label) => ({ label, type: 'keyword' }));\n}\n\n/**\n * Is the cursor inside a literal or IRI that has not been closed yet?\n *\n * A half-typed `\"some tex` or `<http://ex` never reaches a `String` or\n * `IRIRef` node — it is error debris, and the error node covers only the last\n * word — so the node name cannot answer this. Scanning the line up to the\n * cursor can, and it is the state a reader is in while typing one.\n *\n * Two details earn their place. `<<` is not an IRI, so it does not open one,\n * which keeps completion alive inside a half-typed reified triple. And an IRI\n * cannot contain a space, so whitespace closes the scan rather than\n * suppressing completion for the rest of the line.\n *\n * The scan is line-local, so an unterminated *long* string (`\"\"\"…`) spanning\n * lines is not detected past its first line. Terminated ones are, through the\n * `String` node above.\n */\nfunction inUnterminatedTerm(state: EditorState, pos: number): boolean {\n const line = state.doc.lineAt(pos);\n const text = line.text.slice(0, pos - line.from);\n let quote: string | null = null;\n let angle = false;\n for (let i = 0; i < text.length; i++) {\n const ch = text[i];\n if (quote) {\n if (ch === '\\\\') i++;\n else if (ch === quote) quote = null;\n } else if (angle) {\n if (ch === '>' || ch === ' ' || ch === '\\t') angle = false;\n } else if (ch === '\"' || ch === \"'\") {\n quote = ch;\n } else if (ch === '<' && text[i + 1] !== '<') {\n angle = true;\n }\n }\n return quote !== null || angle;\n}\n\n/**\n * Completion for Turtle-family documents.\n *\n * Deliberately context-light: it offers directives, the three term keywords and\n * the document's prefixes wherever a word is being typed, rather than trying to\n * work out whether the cursor is in a subject or an object position. In an\n * error-tolerant tree a half-typed statement usually has no reliable position\n * to read, and a wrong context is worse than a slightly long list.\n */\nexport function turtleCompletionSource(\n options: CompletionOptions = {},\n dialect: 'turtle' | 'trig' = 'turtle'\n) {\n return (context: CompletionContext): CompletionResult | null => {\n const word = context.matchBefore(/[@A-Za-z_][\\w.-]*:?/);\n if (!word && !context.explicit) return null;\n const from = word ? word.from : context.pos;\n\n const node = syntaxTree(context.state).resolveInner(context.pos, -1);\n if (INERT.has(node.name)) return null;\n if (inUnterminatedTerm(context.state, context.pos)) return null;\n\n const directives = dialect === 'trig' ? TRIG_DIRECTIVES : DIRECTIVES;\n return {\n from,\n options: [\n ...keywordCompletions(directives),\n ...keywordCompletions(TERM_KEYWORDS),\n ...prefixCompletions(context.state, options),\n ],\n validFor: /^[@A-Za-z_][\\w.-]*:?$/,\n };\n };\n}\n","import type { SyntaxNode } from '@lezer/common';\nimport type { EditorState } from '@codemirror/state';\nimport {\n LRLanguage,\n LanguageSupport,\n delimitedIndent,\n foldInside,\n foldNodeProp,\n indentNodeProp,\n syntaxTree,\n} from '@codemirror/language';\nimport type { LRParser } from '@lezer/lr';\nimport { parser as rawParser } from './turtle.grammar';\nimport { turtleHighlighting } from './highlight';\nimport { turtleCompletionSource } from './complete';\nimport type { CompletionOptions } from './complete';\n\nexport type { CompletionOptions, PrefixMap, PrefixSource } from './complete';\nexport { documentPrefixes, knownPrefixes, turtleCompletionSource } from './complete';\nexport { turtleHighlighting } from './highlight';\n\n/** The unconfigured grammar, for callers that want their own `top` or props. */\nexport const parser: LRParser = rawParser;\n\n/**\n * Fold a whole statement from the end of its first line.\n *\n * This is the one fold in Turtle with no brackets around it: a subject with a\n * long `;` list is the common shape a reader wants collapsed, and the structure\n * that shape has is a statement, not a delimiter.\n *\n * It stands aside when a bracket opens on the same line. Folding\n * `ex:s ex:p [` at the statement level would hide the `] .` as well, leaving\n * what is left looking unterminated; the bracket's own fold — which CodeMirror\n * would otherwise never reach, since the statement node encloses it — reads\n * correctly.\n */\nconst statementFold = (node: SyntaxNode, state: EditorState) => {\n const firstLineEnd = state.doc.lineAt(node.from).to;\n if (node.to <= firstLineEnd) return null;\n for (let n: SyntaxNode | null = syntaxTree(state).resolveInner(firstLineEnd, -1); n; n = n.parent) {\n if (n.from < node.from) break;\n if (n.type.prop(foldNodeProp) && n.from <= firstLineEnd && n.to > firstLineEnd && n.type !== node.type) return null;\n }\n return { from: firstLineEnd, to: node.to };\n};\n\n/**\n * Highlighting, folding and indentation, shared by all four dialects.\n *\n * Exported so a consumer can re-configure the parser with props of their own —\n * extra `styleTags`, say, to tag the three RDF 1.2 constructs' regions apart\n * rather than all as `quote`. `codemirror-lang-sparql12` exports `sparqlProps`\n * for the same reason.\n */\nexport const turtleProps = [\n turtleHighlighting,\n indentNodeProp.add({\n BlankNodePropertyList: delimitedIndent({ closing: ']' }),\n Collection: delimitedIndent({ closing: ')' }),\n WrappedGraph: delimitedIndent({ closing: '}' }),\n AnnotationBlock: delimitedIndent({ closing: '|}' }),\n TripleTerm: delimitedIndent({ closing: ')>>' }),\n ReifiedTriple: delimitedIndent({ closing: '>>' }),\n }),\n foldNodeProp.add({\n BlankNodePropertyList: foldInside,\n Collection: foldInside,\n WrappedGraph: foldInside,\n AnnotationBlock: foldInside,\n 'Triples Triples2 TriplesOrGraph': statementFold,\n }),\n];\n\nconst languageData = {\n commentTokens: { line: '#' },\n closeBrackets: { brackets: ['[', '(', '<', '\"', \"'\"] },\n indentOnInput: /^\\s*[\\]})]$/,\n};\n\nfunction define(top: string) {\n return LRLanguage.define({\n name: top === 'TurtleDoc' ? 'turtle' : top === 'TrigDoc' ? 'trig' : top === 'NTriplesDoc' ? 'ntriples' : 'nquads',\n parser: rawParser.configure({ top, props: turtleProps }),\n languageData,\n });\n}\n\nexport const turtleLanguage = define('TurtleDoc');\nexport const trigLanguage = define('TrigDoc');\nexport const ntriplesLanguage = define('NTriplesDoc');\nexport const nquadsLanguage = define('NQuadsDoc');\n\nfunction support(language: LRLanguage, options: CompletionOptions, dialect: 'turtle' | 'trig') {\n return new LanguageSupport(language, [\n language.data.of({ autocomplete: turtleCompletionSource(options, dialect) }),\n ]);\n}\n\n/** RDF 1.2 Turtle. */\nexport function turtle(options: CompletionOptions = {}): LanguageSupport {\n return support(turtleLanguage, options, 'turtle');\n}\n\n/** RDF 1.2 TriG. */\nexport function trig(options: CompletionOptions = {}): LanguageSupport {\n return support(trigLanguage, options, 'trig');\n}\n\n/**\n * RDF 1.2 N-Triples.\n *\n * A strict subset with its own entry point rather than Turtle in a lenient\n * mood: a prefixed name or a `;` list in an N-Triples document is an error, and\n * an editor that colours it as valid is lying about the file it will write.\n */\nexport function ntriples(): LanguageSupport {\n return new LanguageSupport(ntriplesLanguage);\n}\n\n/** RDF 1.2 N-Quads. */\nexport function nquads(): LanguageSupport {\n return new LanguageSupport(nquadsLanguage);\n}\n"],"names":["parser","LRParser","styleTags","t","syntaxTree","rawParser","foldNodeProp","indentNodeProp","delimitedIndent","foldInside","LRLanguage","language","LanguageSupport"],"mappings":";;;;;;AAAA;AAEO,MAAMA,QAAM,GAAGC,WAAQ,CAAC,WAAW,CAAC;AAC3C,EAAE,OAAO,EAAE,EAAE;AACb,EAAE,MAAM,EAAE,gpDAAgpD;AAC1pD,EAAE,SAAS,EAAE,gr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,EAAS,OAAO,CAAA,EAAG;AAAA,GAC5E,CAAA;AACH;AAGO,SAAS,MAAA,CAAO,OAAA,GAA6B,EAAC,EAAoB;AACvE,EAAA,OAAO,OAAA,CAAQ,cAAA,EAAgB,OAAA,EAAS,QAAQ,CAAA;AAClD;AAGO,SAAS,IAAA,CAAK,OAAA,GAA6B,EAAC,EAAoB;AACrE,EAAA,OAAO,OAAA,CAAQ,YAAA,EAAc,OAAA,EAAS,MAAM,CAAA;AAC9C;AASO,SAAS,QAAA,GAA4B;AAC1C,EAAA,OAAO,IAAIC,yBAAgB,gBAAgB,CAAA;AAC7C;AAGO,SAAS,MAAA,GAA0B;AACxC,EAAA,OAAO,IAAIA,yBAAgB,cAAc,CAAA;AAC3C;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/turtle.grammar","../src/highlight.ts","../src/complete.ts","../src/lint.ts","../src/index.ts"],"sourcesContent":["// This file was generated by lezer-generator. You probably shouldn't edit it.\nimport {LRParser} from \"@lezer/lr\"\nexport const parser = LRParser.deserialize({\n version: 14,\n states: \"5fQYQPOOQ!WQPOOQ!bQPOOQ!bQPOOOOQO'#Ce'#CeOOQO'#EX'#EXO!jQPO'#CaO!oQPO'#CgO!zQPO'#CiO!oQPO'#CkO#PQPO'#CmO#UQPO'#CmOOQO'#C_'#C_OOQO'#Cv'#CvO$[QQO'#C{O$cQPO'#DOO$qQPO'#DbO$cQPO'#CqO%VQPO'#CqOOQO'#EW'#EWO%kQPO'#EWOOQO'#D{'#D{QYQPOOOOQO'#Dn'#DnO%pQPO'#DqO%}QPO'#DlO&`QPO'#DsO&qQPO'#DsO'SQPO'#DtO$cQPO'#DtOOQO'#Ea'#EaOOQO'#E`'#E`OOQO'#EQ'#EQQ!WQPOOOOQO'#Ec'#EcOOQO'#ER'#ERQ!bQPOOO!oQPO'#DvOOQO'#ES'#ESQ!bQPOOO!oQPO'#DyO!oQPO,58{O'eQPO,59RO!oQPO,59TOOQO,59V,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!z#O#a#j#v$OTnPqSjPqR!eiSnPqQ!fjR#R!eQ!dhR#k#PTsQtTvRwR#p#YQfOR!afQ!Q^R!s!QS#a!z#vS#j#O$OT#u#a#jQ#c!zW#w#c#x$[$^Q#x#dQ$[#OR$^$]Q#f!{S#z#f$aR$a$bQqPR!jqQtQR!ktQwRR!mwTeOfWaOfh#PUgPiqQzVQ|X`!X^!Q![#b#y$Y$Z$_h!Y_abjklm!^!x#_#e$`Q!]`Q!luQ!nxQ!oyQ!q{Q!w!WQ#[!uQ#g!|Q#q#]V#s#^#i#{S!P^!QS!z![#yS#O$Y$_Q#v#bR$O$ZR!x!WR#r#]R!^`R#h!|TpPqQ#X!lQ#Y!nR$W$PSuQtSxRwR#l#W\",\n nodeNames: \"⚠ Comment TurtleDoc Directive . PrefixID AtPrefix PNameNS IRIRef PrefixedName PNameLN Base AtBase SparqlPrefix KwPrefix SparqlBase KwBase Version KwVersion VersionSpecifier AtVersion Triples PredicateObjectList Verb KeywordA ObjectList BlankNode BlankNodeLabel Anon ) ( Collection ] [ BlankNodePropertyList RDFLiteral String LangDir Datatype ^^ NumericLiteral Integer Decimal Double BooleanLiteral True False )>> <<( TripleTerm >> << ReifiedTriple Reifier ~ Annotation |} {| AnnotationBlock , ; TrigDoc GraphStatement KwGraph LabelOrSubject } { WrappedGraph TriplesBlock TriplesOrGraph Triples2 NTriplesDoc NTriple NTripleTerm NQuadsDoc NQuad GraphLabel\",\n maxTerm: 99,\n nodeProps: [\n [\"openedBy\", 29,\"(\",32,\"[\",47,\"<<(\",50,\"<<\",56,\"{|\",65,\"{\"],\n [\"closedBy\", 30,\")\",33,\"]\",48,\")>>\",51,\">>\",57,\"|}\",66,\"}\"]\n ],\n skippedNodes: [0,1],\n repeatNodeCount: 8,\n tokenData: \"#-Z~R!]XY$zYZ$z]^$zpq$zrs%]st,]wx,wxy3kyz3p{|4T|}5{}!O4T!O!P6Q!Q![5^![!]6Y!]!^<j!^!_<o!`!aAZ!b!cAf!c!dL|!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q![L|![!]6Y!c!}L|#R#SL|#T#fL|#f#g#'y#g#oL|$}%OL|%W%oL|%p&aL|&b1pL|1p4UL|4U4dL|4e$ISL|$I`$IbL|$Je$JgL|$Kh%#tL|&/x&EtL|&FV;'SL|?&r?AhL|?BY?MnL|~#'|g}!OL|!O!PNb!Q![L|![!]6Y!c!}L|#R#SL|#T#iL|#i#j#)e#j#oL|$}%OL|%W%oL|%p&aL|&b1pL|1p4UL|4U4dL|4e$ISL|$I`$IbL|$Je$JgL|$Kh%#tL|&/x&EtL|&FV;'SL|?&r?AhL|?BY?MnL|~#)hg}!OL|!O!PNb!Q![L|![!]6Y!c!}L|#R#SL|#T#XL|#X#Y#+P#Y#oL|$}%OL|%W%oL|%p&aL|&b1pL|1p4UL|4U4dL|4e$ISL|$I`$IbL|$Je$JgL|$Kh%#tL|&/x&EtL|&FV;'SL|?&r?AhL|?BY?MnL|~#+Ue}~}!OL|!O!PNb!Q![L|![!]6Y!c!}L|#R#SL|#T#oL|$}%OL|%W%oL|%p&aL|&b1pL|1p4UL|4U4dL|4e$ISL|$I`$IbL|$Je$JgL|$Kh%#tL|&/x&EtL|&FV;'SL|?&r?AhL|?BY?MnL|V#,lP!dP#p#q#,oU#,tO!ZU~#,wP#q#r#,z~#-PO!Y~~#-UO!c~~#-ZO!W~\",\n tokenizers: [0, 1, 2],\n topRules: {\"TurtleDoc\":[0,2],\"TrigDoc\":[1,61],\"NTriplesDoc\":[2,71],\"NQuadsDoc\":[3,74]},\n tokenPrec: 931\n})\n","import type { NodePropSource } from '@lezer/common';\nimport { styleTags, tags as t } from '@lezer/highlight';\n\n/**\n * The shared highlight-tag table, Turtle half.\n *\n * `docs/highlight-tags.md` is the canonical table and `test/highlight.test.ts`\n * asserts this against it, so a consumer can keep one `HighlightStyle` for all\n * three languages. Two conventions are worth knowing:\n *\n * - an IRI and a prefixed name are tagged differently (`url` / `namespace`)\n * but denote the same kind of thing, so a style is free to colour them the\n * same — which is what the reference style does;\n * - a datatype IRI is tagged `typeName` rather than `url`, because it\n * qualifies the literal rather than being a term the document is about. The\n * parent-path rules below are more specific than the bare token rules, so\n * they win inside `Datatype`.\n */\nexport const turtleHighlighting: NodePropSource = styleTags({\n Comment: t.comment,\n\n 'AtPrefix AtBase AtVersion KwPrefix KwBase KwGraph KwVersion KeywordA': t.keyword,\n\n IRIRef: t.url,\n 'PNameNS PNameLN': t.namespace,\n\n 'BlankNodeLabel Anon': t.propertyName,\n\n 'String VersionSpecifier': t.string,\n 'Integer Decimal Double': t.number,\n 'True False': t.bool,\n\n LangDir: t.annotation,\n 'Datatype/IRIRef Datatype/PrefixedName/PNameNS Datatype/PrefixedName/PNameLN': t.typeName,\n 'Datatype/\"^^\"': t.typeName,\n\n /*\n * The RDF 1.2 term brackets are tagged apart from ordinary grouping, because\n * `<< s p o >>` and `<<( s p o )>>` differ by one character and mean quite\n * different things — a statement you can refer to, versus an object that *is*\n * a triple. A style that cannot separate them cannot help a reader see that.\n *\n * Each is a `special()` of the standard tag its glyphs actually are, so the\n * fallback chain does the work: a theme that knows nothing about RDF 1.2 and\n * styles `bracket` (or `brace`/`paren`/`angleBracket`) still colours all of\n * them, and one that wants the distinction overrides the specific tag.\n */\n\n /*\n * Every token *inside* an RDF 1.2 nested-triple construct also carries\n * `quote`, so a style can shade the whole thing and not just its brackets —\n * which is what \"colour reified triples differently\" usually means. The\n * `/...` form applies to descendants and *combines* with each token's own\n * tag, so an IRI inside a reified triple is `quote url`, not one or the\n * other. A style that never mentions `quote` sees no change at all.\n *\n * One tag for all three constructs, rather than three: the brackets above\n * already say which kind it is, and a style wanting per-kind regions can add\n * its own props to the exported parser.\n */\n 'ReifiedTriple/... TripleTerm/... NTripleTerm/... AnnotationBlock/...': t.quote,\n\n '\"<<\" \">>\"': t.special(t.angleBracket),\n '\"<<(\" \")>>\"': t.special(t.paren),\n '\"{|\" \"|}\"': t.special(t.brace),\n '\"{\" \"}\"': t.brace,\n '\"[\" \"]\"': t.squareBracket,\n '\"(\" \")\"': t.paren,\n\n // The reifier marker only ever introduces a reifier, so it is worth telling\n // from arithmetic; it falls back to `operator`.\n '\"~\"': t.special(t.operator),\n\n '\";\" \",\"': t.separator,\n '\".\"': t.punctuation,\n});\n","import { syntaxTree } from '@codemirror/language';\nimport type { Completion, CompletionContext, CompletionResult } from '@codemirror/autocomplete';\nimport type { EditorState } from '@codemirror/state';\n\n/** A prefix label (without the colon) mapped to the IRI it expands to. */\nexport type PrefixMap = Record<string, string>;\n\n/** Where `turtle()` and friends may look for prefixes beyond the document. */\nexport type PrefixSource = PrefixMap | ((state: EditorState) => PrefixMap);\n\nexport interface CompletionOptions {\n /**\n * Prefixes the editor should offer even when the document has not declared\n * them — an application's own prefix manager, typically. Document\n * declarations win on conflict, because what the document says is what the\n * document means.\n */\n prefixSource?: PrefixSource;\n}\n\nconst DIRECTIVES = ['@prefix', '@base', 'PREFIX', 'BASE'];\nconst TRIG_DIRECTIVES = [...DIRECTIVES, 'GRAPH'];\nconst TERM_KEYWORDS = ['a', 'true', 'false'];\n\n/** Nodes whose interior is text, not syntax: no completion belongs there. */\nconst INERT = new Set(['Comment', 'String', 'VersionSpecifier', 'IRIRef']);\n\n/**\n * The prefixes declared by the document itself, read from the syntax tree.\n *\n * Both spellings are read — `@prefix ex: <…>` and `PREFIX ex: <…>` — because a\n * document may mix them, and a reader completing `ex:` does not care which one\n * declared it.\n */\nexport function documentPrefixes(state: EditorState): PrefixMap {\n const prefixes: PrefixMap = {};\n const tree = syntaxTree(state);\n tree.iterate({\n enter: (node) => {\n if (node.name !== 'PrefixID' && node.name !== 'SparqlPrefix') return;\n let label: string | null = null;\n let iri: string | null = null;\n for (let child = node.node.firstChild; child; child = child.nextSibling) {\n if (child.name === 'PNameNS' && label === null) {\n label = state.sliceDoc(child.from, child.to).slice(0, -1);\n } else if (child.name === 'IRIRef' && iri === null) {\n iri = state.sliceDoc(child.from + 1, child.to - 1);\n }\n }\n if (label !== null) prefixes[label] = iri ?? '';\n },\n });\n return prefixes;\n}\n\nfunction resolveSource(source: PrefixSource | undefined, state: EditorState): PrefixMap {\n if (!source) return {};\n return typeof source === 'function' ? source(state) : source;\n}\n\n/** Every prefix the editor knows about: the external source, overlaid by the document's. */\nexport function knownPrefixes(state: EditorState, options: CompletionOptions = {}): PrefixMap {\n return { ...resolveSource(options.prefixSource, state), ...documentPrefixes(state) };\n}\n\nfunction prefixCompletions(state: EditorState, options: CompletionOptions): Completion[] {\n const prefixes = knownPrefixes(state, options);\n return Object.entries(prefixes).map(([label, iri]) => ({\n label: `${label}:`,\n type: 'namespace',\n detail: iri || undefined,\n }));\n}\n\nfunction keywordCompletions(words: readonly string[]): Completion[] {\n return words.map((label) => ({ label, type: 'keyword' }));\n}\n\n/**\n * Is the cursor inside a literal or IRI that has not been closed yet?\n *\n * A half-typed `\"some tex` or `<http://ex` never reaches a `String` or\n * `IRIRef` node — it is error debris, and the error node covers only the last\n * word — so the node name cannot answer this. Scanning the line up to the\n * cursor can, and it is the state a reader is in while typing one.\n *\n * Two details earn their place. `<<` is not an IRI, so it does not open one,\n * which keeps completion alive inside a half-typed reified triple. And an IRI\n * cannot contain a space, so whitespace closes the scan rather than\n * suppressing completion for the rest of the line.\n *\n * The scan is line-local, so an unterminated *long* string (`\"\"\"…`) spanning\n * lines is not detected past its first line. Terminated ones are, through the\n * `String` node above.\n */\nfunction inUnterminatedTerm(state: EditorState, pos: number): boolean {\n const line = state.doc.lineAt(pos);\n const text = line.text.slice(0, pos - line.from);\n let quote: string | null = null;\n let angle = false;\n for (let i = 0; i < text.length; i++) {\n const ch = text[i];\n if (quote) {\n if (ch === '\\\\') i++;\n else if (ch === quote) quote = null;\n } else if (angle) {\n if (ch === '>' || ch === ' ' || ch === '\\t') angle = false;\n } else if (ch === '\"' || ch === \"'\") {\n quote = ch;\n } else if (ch === '<' && text[i + 1] !== '<') {\n angle = true;\n }\n }\n return quote !== null || angle;\n}\n\n/**\n * Completion for Turtle-family documents.\n *\n * Deliberately context-light: it offers directives, the three term keywords and\n * the document's prefixes wherever a word is being typed, rather than trying to\n * work out whether the cursor is in a subject or an object position. In an\n * error-tolerant tree a half-typed statement usually has no reliable position\n * to read, and a wrong context is worse than a slightly long list.\n */\nexport function turtleCompletionSource(\n options: CompletionOptions = {},\n dialect: 'turtle' | 'trig' = 'turtle'\n) {\n return (context: CompletionContext): CompletionResult | null => {\n const word = context.matchBefore(/[@A-Za-z_][\\w.-]*:?/);\n if (!word && !context.explicit) return null;\n const from = word ? word.from : context.pos;\n\n const node = syntaxTree(context.state).resolveInner(context.pos, -1);\n if (INERT.has(node.name)) return null;\n if (inUnterminatedTerm(context.state, context.pos)) return null;\n\n const directives = dialect === 'trig' ? TRIG_DIRECTIVES : DIRECTIVES;\n return {\n from,\n options: [\n ...keywordCompletions(directives),\n ...keywordCompletions(TERM_KEYWORDS),\n ...prefixCompletions(context.state, options),\n ],\n validFor: /^[@A-Za-z_][\\w.-]*:?$/,\n };\n };\n}\n","import { ensureSyntaxTree } from '@codemirror/language';\nimport { linter } from '@codemirror/lint';\nimport type { EditorState, Extension } from '@codemirror/state';\n\nexport interface ParseError {\n from: number;\n to: number;\n message: string;\n}\n\n/**\n * How long to spend completing the parse before reporting errors. A partial\n * tree ends in error nodes that are not in the document, so nothing is\n * reported until the parse reaches the end.\n */\nconst PARSE_TIMEOUT_MS = 1000;\n\n/** Whitespace and `#` comments: what may separate error nodes in one run. */\nconst GAP = /^(?:\\s|#.*)*$/;\n\n/**\n * Every parse error in the document.\n *\n * The parser recovers by skipping one token at a time, so `this is a test`\n * produces four error nodes. Nodes separated only by whitespace or comments are\n * merged into one error.\n */\nexport function parseErrors(state: EditorState): ParseError[] {\n const tree = ensureSyntaxTree(state, state.doc.length, PARSE_TIMEOUT_MS);\n if (!tree) return [];\n const runs: { from: number; to: number }[] = [];\n tree.iterate({\n enter: (node) => {\n if (!node.type.isError) return;\n const last = runs[runs.length - 1];\n if (last && (node.from <= last.to || GAP.test(state.sliceDoc(last.to, node.from))))\n last.to = Math.max(last.to, node.to);\n else runs.push({ from: node.from, to: node.to });\n },\n });\n return runs.map(({ from, to }) => ({ from, to, message: errorMessage(state.sliceDoc(from, to)) }));\n}\n\nfunction errorMessage(text: string): string {\n const shown = text.replace(/\\s+/g, ' ').trim();\n if (!shown) return 'Syntax error.';\n return `Unexpected “${shown.length > 32 ? `${shown.slice(0, 32)}…` : shown}”.`;\n}\n\n/** Underline every parse error. Included in `turtle()`, `trig()`, `ntriples()` and `nquads()`. */\nexport function parseErrorLinter(): Extension {\n return linter((view) => parseErrors(view.state).map((error) => ({ ...error, severity: 'error' })));\n}\n","import type { SyntaxNode } from '@lezer/common';\nimport type { EditorState } from '@codemirror/state';\nimport {\n LRLanguage,\n LanguageSupport,\n delimitedIndent,\n foldInside,\n foldNodeProp,\n indentNodeProp,\n syntaxTree,\n} from '@codemirror/language';\nimport type { LRParser } from '@lezer/lr';\nimport { parser as rawParser } from './turtle.grammar';\nimport { turtleHighlighting } from './highlight';\nimport { turtleCompletionSource } from './complete';\nimport type { CompletionOptions } from './complete';\nimport { parseErrorLinter } from './lint';\n\nexport type { CompletionOptions, PrefixMap, PrefixSource } from './complete';\nexport { documentPrefixes, knownPrefixes, turtleCompletionSource } from './complete';\nexport { turtleHighlighting } from './highlight';\nexport { parseErrorLinter, parseErrors } from './lint';\nexport type { ParseError } from './lint';\n\n/** The unconfigured grammar, for callers that want their own `top` or props. */\nexport const parser: LRParser = rawParser;\n\n/**\n * Fold a whole statement from the end of its first line.\n *\n * This is the one fold in Turtle with no brackets around it: a subject with a\n * long `;` list is the common shape a reader wants collapsed, and the structure\n * that shape has is a statement, not a delimiter.\n *\n * It stands aside when a bracket opens on the same line. Folding\n * `ex:s ex:p [` at the statement level would hide the `] .` as well, leaving\n * what is left looking unterminated; the bracket's own fold — which CodeMirror\n * would otherwise never reach, since the statement node encloses it — reads\n * correctly.\n */\nconst statementFold = (node: SyntaxNode, state: EditorState) => {\n const firstLineEnd = state.doc.lineAt(node.from).to;\n if (node.to <= firstLineEnd) return null;\n for (let n: SyntaxNode | null = syntaxTree(state).resolveInner(firstLineEnd, -1); n; n = n.parent) {\n if (n.from < node.from) break;\n if (n.type.prop(foldNodeProp) && n.from <= firstLineEnd && n.to > firstLineEnd && n.type !== node.type) return null;\n }\n return { from: firstLineEnd, to: node.to };\n};\n\n/**\n * Highlighting, folding and indentation, shared by all four dialects.\n *\n * Exported so a consumer can re-configure the parser with props of their own —\n * extra `styleTags`, say, to tag the three RDF 1.2 constructs' regions apart\n * rather than all as `quote`. `codemirror-lang-sparql12` exports `sparqlProps`\n * for the same reason.\n */\nexport const turtleProps = [\n turtleHighlighting,\n indentNodeProp.add({\n BlankNodePropertyList: delimitedIndent({ closing: ']' }),\n Collection: delimitedIndent({ closing: ')' }),\n WrappedGraph: delimitedIndent({ closing: '}' }),\n AnnotationBlock: delimitedIndent({ closing: '|}' }),\n TripleTerm: delimitedIndent({ closing: ')>>' }),\n ReifiedTriple: delimitedIndent({ closing: '>>' }),\n }),\n foldNodeProp.add({\n BlankNodePropertyList: foldInside,\n Collection: foldInside,\n WrappedGraph: foldInside,\n AnnotationBlock: foldInside,\n 'Triples Triples2 TriplesOrGraph': statementFold,\n }),\n];\n\nconst languageData = {\n commentTokens: { line: '#' },\n closeBrackets: { brackets: ['[', '(', '<', '\"', \"'\"] },\n indentOnInput: /^\\s*[\\]})]$/,\n};\n\nfunction define(top: string) {\n return LRLanguage.define({\n name: top === 'TurtleDoc' ? 'turtle' : top === 'TrigDoc' ? 'trig' : top === 'NTriplesDoc' ? 'ntriples' : 'nquads',\n parser: rawParser.configure({ top, props: turtleProps }),\n languageData,\n });\n}\n\nexport const turtleLanguage = define('TurtleDoc');\nexport const trigLanguage = define('TrigDoc');\nexport const ntriplesLanguage = define('NTriplesDoc');\nexport const nquadsLanguage = define('NQuadsDoc');\n\nfunction support(language: LRLanguage, options: CompletionOptions, dialect: 'turtle' | 'trig') {\n return new LanguageSupport(language, [\n language.data.of({ autocomplete: turtleCompletionSource(options, dialect) }),\n parseErrorLinter(),\n ]);\n}\n\n/** RDF 1.2 Turtle. */\nexport function turtle(options: CompletionOptions = {}): LanguageSupport {\n return support(turtleLanguage, options, 'turtle');\n}\n\n/** RDF 1.2 TriG. */\nexport function trig(options: CompletionOptions = {}): LanguageSupport {\n return support(trigLanguage, options, 'trig');\n}\n\n/**\n * RDF 1.2 N-Triples.\n *\n * A strict subset with its own entry point rather than Turtle in a lenient\n * mood: a prefixed name or a `;` list in an N-Triples document is an error, and\n * an editor that colours it as valid is lying about the file it will write.\n */\nexport function ntriples(): LanguageSupport {\n return new LanguageSupport(ntriplesLanguage, parseErrorLinter());\n}\n\n/** RDF 1.2 N-Quads. */\nexport function nquads(): LanguageSupport {\n return new LanguageSupport(nquadsLanguage, parseErrorLinter());\n}\n"],"names":["parser","LRParser","styleTags","t","syntaxTree","ensureSyntaxTree","linter","rawParser","foldNodeProp","indentNodeProp","delimitedIndent","foldInside","LRLanguage","language","LanguageSupport"],"mappings":";;;;;;;AAAA;AAEO,MAAMA,QAAM,GAAGC,WAAQ,CAAC,WAAW,CAAC;AAC3C,EAAE,OAAO,EAAE,EAAE;AACb,EAAE,MAAM,EAAE,gpDAAgpD;AAC1pD,EAAE,SAAS,EAAE,grCAAgrC;AAC7rC,EAAE,IAAI,EAAE,k8BAAk8B;AAC18B,EAAE,SAAS,EAAE,+oBAA+oB;AAC5pB,EAAE,OAAO,EAAE,EAAE;AACb,EAAE,SAAS,EAAE;AACb,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC;AAC/D,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC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gBAAA;AAAiB,GAClB,CAAA;AACH;AAGO,SAAS,MAAA,CAAO,OAAA,GAA6B,EAAC,EAAoB;AACvE,EAAA,OAAO,OAAA,CAAQ,cAAA,EAAgB,OAAA,EAAS,QAAQ,CAAA;AAClD;AAGO,SAAS,IAAA,CAAK,OAAA,GAA6B,EAAC,EAAoB;AACrE,EAAA,OAAO,OAAA,CAAQ,YAAA,EAAc,OAAA,EAAS,MAAM,CAAA;AAC9C;AASO,SAAS,QAAA,GAA4B;AAC1C,EAAA,OAAO,IAAIC,wBAAA,CAAgB,gBAAA,EAAkB,gBAAA,EAAkB,CAAA;AACjE;AAGO,SAAS,MAAA,GAA0B;AACxC,EAAA,OAAO,IAAIA,wBAAA,CAAgB,cAAA,EAAgB,gBAAA,EAAkB,CAAA;AAC/D;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ import type { CompletionOptions } from './complete';
|
|
|
4
4
|
export type { CompletionOptions, PrefixMap, PrefixSource } from './complete';
|
|
5
5
|
export { documentPrefixes, knownPrefixes, turtleCompletionSource } from './complete';
|
|
6
6
|
export { turtleHighlighting } from './highlight';
|
|
7
|
+
export { parseErrorLinter, parseErrors } from './lint';
|
|
8
|
+
export type { ParseError } from './lint';
|
|
7
9
|
/** The unconfigured grammar, for callers that want their own `top` or props. */
|
|
8
10
|
export declare const parser: LRParser;
|
|
9
11
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { syntaxTree, indentNodeProp, delimitedIndent, foldNodeProp, foldInside, LRLanguage, LanguageSupport } from '@codemirror/language';
|
|
1
|
+
import { syntaxTree, ensureSyntaxTree, indentNodeProp, delimitedIndent, foldNodeProp, foldInside, LRLanguage, LanguageSupport } from '@codemirror/language';
|
|
2
2
|
import { LRParser } from '@lezer/lr';
|
|
3
3
|
import { styleTags, tags } from '@lezer/highlight';
|
|
4
|
+
import { linter } from '@codemirror/lint';
|
|
4
5
|
|
|
5
6
|
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
6
7
|
const parser$1 = LRParser.deserialize({
|
|
@@ -154,6 +155,32 @@ function turtleCompletionSource(options = {}, dialect = "turtle") {
|
|
|
154
155
|
};
|
|
155
156
|
}
|
|
156
157
|
|
|
158
|
+
const PARSE_TIMEOUT_MS = 1e3;
|
|
159
|
+
const GAP = /^(?:\s|#.*)*$/;
|
|
160
|
+
function parseErrors(state) {
|
|
161
|
+
const tree = ensureSyntaxTree(state, state.doc.length, PARSE_TIMEOUT_MS);
|
|
162
|
+
if (!tree) return [];
|
|
163
|
+
const runs = [];
|
|
164
|
+
tree.iterate({
|
|
165
|
+
enter: (node) => {
|
|
166
|
+
if (!node.type.isError) return;
|
|
167
|
+
const last = runs[runs.length - 1];
|
|
168
|
+
if (last && (node.from <= last.to || GAP.test(state.sliceDoc(last.to, node.from))))
|
|
169
|
+
last.to = Math.max(last.to, node.to);
|
|
170
|
+
else runs.push({ from: node.from, to: node.to });
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
return runs.map(({ from, to }) => ({ from, to, message: errorMessage(state.sliceDoc(from, to)) }));
|
|
174
|
+
}
|
|
175
|
+
function errorMessage(text) {
|
|
176
|
+
const shown = text.replace(/\s+/g, " ").trim();
|
|
177
|
+
if (!shown) return "Syntax error.";
|
|
178
|
+
return `Unexpected \u201C${shown.length > 32 ? `${shown.slice(0, 32)}\u2026` : shown}\u201D.`;
|
|
179
|
+
}
|
|
180
|
+
function parseErrorLinter() {
|
|
181
|
+
return linter((view) => parseErrors(view.state).map((error) => ({ ...error, severity: "error" })));
|
|
182
|
+
}
|
|
183
|
+
|
|
157
184
|
const parser = parser$1;
|
|
158
185
|
const statementFold = (node, state) => {
|
|
159
186
|
const firstLineEnd = state.doc.lineAt(node.from).to;
|
|
@@ -200,7 +227,8 @@ const ntriplesLanguage = define("NTriplesDoc");
|
|
|
200
227
|
const nquadsLanguage = define("NQuadsDoc");
|
|
201
228
|
function support(language, options, dialect) {
|
|
202
229
|
return new LanguageSupport(language, [
|
|
203
|
-
language.data.of({ autocomplete: turtleCompletionSource(options, dialect) })
|
|
230
|
+
language.data.of({ autocomplete: turtleCompletionSource(options, dialect) }),
|
|
231
|
+
parseErrorLinter()
|
|
204
232
|
]);
|
|
205
233
|
}
|
|
206
234
|
function turtle(options = {}) {
|
|
@@ -210,11 +238,11 @@ function trig(options = {}) {
|
|
|
210
238
|
return support(trigLanguage, options, "trig");
|
|
211
239
|
}
|
|
212
240
|
function ntriples() {
|
|
213
|
-
return new LanguageSupport(ntriplesLanguage);
|
|
241
|
+
return new LanguageSupport(ntriplesLanguage, parseErrorLinter());
|
|
214
242
|
}
|
|
215
243
|
function nquads() {
|
|
216
|
-
return new LanguageSupport(nquadsLanguage);
|
|
244
|
+
return new LanguageSupport(nquadsLanguage, parseErrorLinter());
|
|
217
245
|
}
|
|
218
246
|
|
|
219
|
-
export { documentPrefixes, knownPrefixes, nquads, nquadsLanguage, ntriples, ntriplesLanguage, parser, trig, trigLanguage, turtle, turtleCompletionSource, turtleHighlighting, turtleLanguage, turtleProps };
|
|
247
|
+
export { documentPrefixes, knownPrefixes, nquads, nquadsLanguage, ntriples, ntriplesLanguage, parseErrorLinter, parseErrors, parser, trig, trigLanguage, turtle, turtleCompletionSource, turtleHighlighting, turtleLanguage, turtleProps };
|
|
220
248
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/turtle.grammar","../src/highlight.ts","../src/complete.ts","../src/index.ts"],"sourcesContent":["// This file was generated by lezer-generator. You probably shouldn't edit it.\nimport {LRParser} from \"@lezer/lr\"\nexport const parser = LRParser.deserialize({\n version: 14,\n states: \"5fQYQPOOQ!WQPOOQ!bQPOOQ!bQPOOOOQO'#Ce'#CeOOQO'#EX'#EXO!jQPO'#CaO!oQPO'#CgO!zQPO'#CiO!oQPO'#CkO#PQPO'#CmO#UQPO'#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]!xQ#y#e[$YabjklmR$_$`Q!{![S$U#y$_R$b$YWaOfh#PUgPiq`!X^!Q![#b#y$Y$Z$_Q!]`Q!w!WQ#g!|Q#q#]V#s#^#i#{WaOfh#PSmPqa!X^!Q![#b#y$Y$Z$_WbOfh#PSlPqa!X^!Q![#b#y$Y$Z$_d!V^!Q![!|#]#b#y$Y$Z$_V#V!l!n$PV!v!S!}#Ue!V^!Q![!|#]#b#y$Y$Z$_`!X^!Q![#b#y$Y$Z$_Q#g!|R#q#]WbOfh#PSkPq`!X^!Q![#b#y$Y$Z$_Q!]`R#g!|[#`!z#O#a#j#v$OR#}#hQ#d!zS$T#v$OR$]#O]#`!z#O#a#j#v$OTnPqSjPqR!eiSnPqQ!fjR#R!eQ!dhR#k#PTsQtTvRwR#p#YQfOR!afQ!Q^R!s!QS#a!z#vS#j#O$OT#u#a#jQ#c!zW#w#c#x$[$^Q#x#dQ$[#OR$^$]Q#f!{S#z#f$aR$a$bQqPR!jqQtQR!ktQwRR!mwTeOfWaOfh#PUgPiqQzVQ|X`!X^!Q![#b#y$Y$Z$_h!Y_abjklm!^!x#_#e$`Q!]`Q!luQ!nxQ!oyQ!q{Q!w!WQ#[!uQ#g!|Q#q#]V#s#^#i#{S!P^!QS!z![#yS#O$Y$_Q#v#bR$O$ZR!x!WR#r#]R!^`R#h!|TpPqQ#X!lQ#Y!nR$W$PSuQtSxRwR#l#W\",\n nodeNames: \"⚠ Comment TurtleDoc Directive . PrefixID AtPrefix PNameNS IRIRef PrefixedName PNameLN Base AtBase SparqlPrefix KwPrefix SparqlBase KwBase Version KwVersion VersionSpecifier AtVersion Triples PredicateObjectList Verb KeywordA ObjectList BlankNode BlankNodeLabel Anon ) ( Collection ] [ BlankNodePropertyList RDFLiteral String LangDir Datatype ^^ NumericLiteral Integer Decimal Double BooleanLiteral True False )>> <<( TripleTerm >> << ReifiedTriple Reifier ~ Annotation |} {| AnnotationBlock , ; TrigDoc GraphStatement KwGraph LabelOrSubject } { WrappedGraph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ers: [0, 1, 2],\n topRules: {\"TurtleDoc\":[0,2],\"TrigDoc\":[1,61],\"NTriplesDoc\":[2,71],\"NQuadsDoc\":[3,74]},\n tokenPrec: 931\n})\n","import type { NodePropSource } from '@lezer/common';\nimport { styleTags, tags as t } from '@lezer/highlight';\n\n/**\n * The shared highlight-tag table, Turtle half.\n *\n * `docs/highlight-tags.md` is the canonical table and `test/highlight.test.ts`\n * asserts this against it, so a consumer can keep one `HighlightStyle` for all\n * three languages. Two conventions are worth knowing:\n *\n * - an IRI and a prefixed name are tagged differently (`url` / `namespace`)\n * but denote the same kind of thing, so a style is free to colour them the\n * same — which is what the reference style does;\n * - a datatype IRI is tagged `typeName` rather than `url`, because it\n * qualifies the literal rather than being a term the document is about. The\n * parent-path rules below are more specific than the bare token rules, so\n * they win inside `Datatype`.\n */\nexport const turtleHighlighting: NodePropSource = styleTags({\n Comment: t.comment,\n\n 'AtPrefix AtBase AtVersion KwPrefix KwBase KwGraph KwVersion KeywordA': t.keyword,\n\n IRIRef: t.url,\n 'PNameNS PNameLN': t.namespace,\n\n 'BlankNodeLabel Anon': t.propertyName,\n\n 'String VersionSpecifier': t.string,\n 'Integer Decimal Double': t.number,\n 'True False': t.bool,\n\n LangDir: t.annotation,\n 'Datatype/IRIRef Datatype/PrefixedName/PNameNS Datatype/PrefixedName/PNameLN': t.typeName,\n 'Datatype/\"^^\"': t.typeName,\n\n /*\n * The RDF 1.2 term brackets are tagged apart from ordinary grouping, because\n * `<< s p o >>` and `<<( s p o )>>` differ by one character and mean quite\n * different things — a statement you can refer to, versus an object that *is*\n * a triple. A style that cannot separate them cannot help a reader see that.\n *\n * Each is a `special()` of the standard tag its glyphs actually are, so the\n * fallback chain does the work: a theme that knows nothing about RDF 1.2 and\n * styles `bracket` (or `brace`/`paren`/`angleBracket`) still colours all of\n * them, and one that wants the distinction overrides the specific tag.\n */\n\n /*\n * Every token *inside* an RDF 1.2 nested-triple construct also carries\n * `quote`, so a style can shade the whole thing and not just its brackets —\n * which is what \"colour reified triples differently\" usually means. The\n * `/...` form applies to descendants and *combines* with each token's own\n * tag, so an IRI inside a reified triple is `quote url`, not one or the\n * other. A style that never mentions `quote` sees no change at all.\n *\n * One tag for all three constructs, rather than three: the brackets above\n * already say which kind it is, and a style wanting per-kind regions can add\n * its own props to the exported parser.\n */\n 'ReifiedTriple/... TripleTerm/... NTripleTerm/... AnnotationBlock/...': t.quote,\n\n '\"<<\" \">>\"': t.special(t.angleBracket),\n '\"<<(\" \")>>\"': t.special(t.paren),\n '\"{|\" \"|}\"': t.special(t.brace),\n '\"{\" \"}\"': t.brace,\n '\"[\" \"]\"': t.squareBracket,\n '\"(\" \")\"': t.paren,\n\n // The reifier marker only ever introduces a reifier, so it is worth telling\n // from arithmetic; it falls back to `operator`.\n '\"~\"': t.special(t.operator),\n\n '\";\" \",\"': t.separator,\n '\".\"': t.punctuation,\n});\n","import { syntaxTree } from '@codemirror/language';\nimport type { Completion, CompletionContext, CompletionResult } from '@codemirror/autocomplete';\nimport type { EditorState } from '@codemirror/state';\n\n/** A prefix label (without the colon) mapped to the IRI it expands to. */\nexport type PrefixMap = Record<string, string>;\n\n/** Where `turtle()` and friends may look for prefixes beyond the document. */\nexport type PrefixSource = PrefixMap | ((state: EditorState) => PrefixMap);\n\nexport interface CompletionOptions {\n /**\n * Prefixes the editor should offer even when the document has not declared\n * them — an application's own prefix manager, typically. Document\n * declarations win on conflict, because what the document says is what the\n * document means.\n */\n prefixSource?: PrefixSource;\n}\n\nconst DIRECTIVES = ['@prefix', '@base', 'PREFIX', 'BASE'];\nconst TRIG_DIRECTIVES = [...DIRECTIVES, 'GRAPH'];\nconst TERM_KEYWORDS = ['a', 'true', 'false'];\n\n/** Nodes whose interior is text, not syntax: no completion belongs there. */\nconst INERT = new Set(['Comment', 'String', 'VersionSpecifier', 'IRIRef']);\n\n/**\n * The prefixes declared by the document itself, read from the syntax tree.\n *\n * Both spellings are read — `@prefix ex: <…>` and `PREFIX ex: <…>` — because a\n * document may mix them, and a reader completing `ex:` does not care which one\n * declared it.\n */\nexport function documentPrefixes(state: EditorState): PrefixMap {\n const prefixes: PrefixMap = {};\n const tree = syntaxTree(state);\n tree.iterate({\n enter: (node) => {\n if (node.name !== 'PrefixID' && node.name !== 'SparqlPrefix') return;\n let label: string | null = null;\n let iri: string | null = null;\n for (let child = node.node.firstChild; child; child = child.nextSibling) {\n if (child.name === 'PNameNS' && label === null) {\n label = state.sliceDoc(child.from, child.to).slice(0, -1);\n } else if (child.name === 'IRIRef' && iri === null) {\n iri = state.sliceDoc(child.from + 1, child.to - 1);\n }\n }\n if (label !== null) prefixes[label] = iri ?? '';\n },\n });\n return prefixes;\n}\n\nfunction resolveSource(source: PrefixSource | undefined, state: EditorState): PrefixMap {\n if (!source) return {};\n return typeof source === 'function' ? source(state) : source;\n}\n\n/** Every prefix the editor knows about: the external source, overlaid by the document's. */\nexport function knownPrefixes(state: EditorState, options: CompletionOptions = {}): PrefixMap {\n return { ...resolveSource(options.prefixSource, state), ...documentPrefixes(state) };\n}\n\nfunction prefixCompletions(state: EditorState, options: CompletionOptions): Completion[] {\n const prefixes = knownPrefixes(state, options);\n return Object.entries(prefixes).map(([label, iri]) => ({\n label: `${label}:`,\n type: 'namespace',\n detail: iri || undefined,\n }));\n}\n\nfunction keywordCompletions(words: readonly string[]): Completion[] {\n return words.map((label) => ({ label, type: 'keyword' }));\n}\n\n/**\n * Is the cursor inside a literal or IRI that has not been closed yet?\n *\n * A half-typed `\"some tex` or `<http://ex` never reaches a `String` or\n * `IRIRef` node — it is error debris, and the error node covers only the last\n * word — so the node name cannot answer this. Scanning the line up to the\n * cursor can, and it is the state a reader is in while typing one.\n *\n * Two details earn their place. `<<` is not an IRI, so it does not open one,\n * which keeps completion alive inside a half-typed reified triple. And an IRI\n * cannot contain a space, so whitespace closes the scan rather than\n * suppressing completion for the rest of the line.\n *\n * The scan is line-local, so an unterminated *long* string (`\"\"\"…`) spanning\n * lines is not detected past its first line. Terminated ones are, through the\n * `String` node above.\n */\nfunction inUnterminatedTerm(state: EditorState, pos: number): boolean {\n const line = state.doc.lineAt(pos);\n const text = line.text.slice(0, pos - line.from);\n let quote: string | null = null;\n let angle = false;\n for (let i = 0; i < text.length; i++) {\n const ch = text[i];\n if (quote) {\n if (ch === '\\\\') i++;\n else if (ch === quote) quote = null;\n } else if (angle) {\n if (ch === '>' || ch === ' ' || ch === '\\t') angle = false;\n } else if (ch === '\"' || ch === \"'\") {\n quote = ch;\n } else if (ch === '<' && text[i + 1] !== '<') {\n angle = true;\n }\n }\n return quote !== null || angle;\n}\n\n/**\n * Completion for Turtle-family documents.\n *\n * Deliberately context-light: it offers directives, the three term keywords and\n * the document's prefixes wherever a word is being typed, rather than trying to\n * work out whether the cursor is in a subject or an object position. In an\n * error-tolerant tree a half-typed statement usually has no reliable position\n * to read, and a wrong context is worse than a slightly long list.\n */\nexport function turtleCompletionSource(\n options: CompletionOptions = {},\n dialect: 'turtle' | 'trig' = 'turtle'\n) {\n return (context: CompletionContext): CompletionResult | null => {\n const word = context.matchBefore(/[@A-Za-z_][\\w.-]*:?/);\n if (!word && !context.explicit) return null;\n const from = word ? word.from : context.pos;\n\n const node = syntaxTree(context.state).resolveInner(context.pos, -1);\n if (INERT.has(node.name)) return null;\n if (inUnterminatedTerm(context.state, context.pos)) return null;\n\n const directives = dialect === 'trig' ? TRIG_DIRECTIVES : DIRECTIVES;\n return {\n from,\n options: [\n ...keywordCompletions(directives),\n ...keywordCompletions(TERM_KEYWORDS),\n ...prefixCompletions(context.state, options),\n ],\n validFor: /^[@A-Za-z_][\\w.-]*:?$/,\n };\n };\n}\n","import type { SyntaxNode } from '@lezer/common';\nimport type { EditorState } from '@codemirror/state';\nimport {\n LRLanguage,\n LanguageSupport,\n delimitedIndent,\n foldInside,\n foldNodeProp,\n indentNodeProp,\n syntaxTree,\n} from '@codemirror/language';\nimport type { LRParser } from '@lezer/lr';\nimport { parser as rawParser } from './turtle.grammar';\nimport { turtleHighlighting } from './highlight';\nimport { turtleCompletionSource } from './complete';\nimport type { CompletionOptions } from './complete';\n\nexport type { CompletionOptions, PrefixMap, PrefixSource } from './complete';\nexport { documentPrefixes, knownPrefixes, turtleCompletionSource } from './complete';\nexport { turtleHighlighting } from './highlight';\n\n/** The unconfigured grammar, for callers that want their own `top` or props. */\nexport const parser: LRParser = rawParser;\n\n/**\n * Fold a whole statement from the end of its first line.\n *\n * This is the one fold in Turtle with no brackets around it: a subject with a\n * long `;` list is the common shape a reader wants collapsed, and the structure\n * that shape has is a statement, not a delimiter.\n *\n * It stands aside when a bracket opens on the same line. Folding\n * `ex:s ex:p [` at the statement level would hide the `] .` as well, leaving\n * what is left looking unterminated; the bracket's own fold — which CodeMirror\n * would otherwise never reach, since the statement node encloses it — reads\n * correctly.\n */\nconst statementFold = (node: SyntaxNode, state: EditorState) => {\n const firstLineEnd = state.doc.lineAt(node.from).to;\n if (node.to <= firstLineEnd) return null;\n for (let n: SyntaxNode | null = syntaxTree(state).resolveInner(firstLineEnd, -1); n; n = n.parent) {\n if (n.from < node.from) break;\n if (n.type.prop(foldNodeProp) && n.from <= firstLineEnd && n.to > firstLineEnd && n.type !== node.type) return null;\n }\n return { from: firstLineEnd, to: node.to };\n};\n\n/**\n * Highlighting, folding and indentation, shared by all four dialects.\n *\n * Exported so a consumer can re-configure the parser with props of their own —\n * extra `styleTags`, say, to tag the three RDF 1.2 constructs' regions apart\n * rather than all as `quote`. `codemirror-lang-sparql12` exports `sparqlProps`\n * for the same reason.\n */\nexport const turtleProps = [\n turtleHighlighting,\n indentNodeProp.add({\n BlankNodePropertyList: delimitedIndent({ closing: ']' }),\n Collection: delimitedIndent({ closing: ')' }),\n WrappedGraph: delimitedIndent({ closing: '}' }),\n AnnotationBlock: delimitedIndent({ closing: '|}' }),\n TripleTerm: delimitedIndent({ closing: ')>>' }),\n ReifiedTriple: delimitedIndent({ closing: '>>' }),\n }),\n foldNodeProp.add({\n BlankNodePropertyList: foldInside,\n Collection: foldInside,\n WrappedGraph: foldInside,\n AnnotationBlock: foldInside,\n 'Triples Triples2 TriplesOrGraph': statementFold,\n }),\n];\n\nconst languageData = {\n commentTokens: { line: '#' },\n closeBrackets: { brackets: ['[', '(', '<', '\"', \"'\"] },\n indentOnInput: /^\\s*[\\]})]$/,\n};\n\nfunction define(top: string) {\n return LRLanguage.define({\n name: top === 'TurtleDoc' ? 'turtle' : top === 'TrigDoc' ? 'trig' : top === 'NTriplesDoc' ? 'ntriples' : 'nquads',\n parser: rawParser.configure({ top, props: turtleProps }),\n languageData,\n });\n}\n\nexport const turtleLanguage = define('TurtleDoc');\nexport const trigLanguage = define('TrigDoc');\nexport const ntriplesLanguage = define('NTriplesDoc');\nexport const nquadsLanguage = define('NQuadsDoc');\n\nfunction support(language: LRLanguage, options: CompletionOptions, dialect: 'turtle' | 'trig') {\n return new LanguageSupport(language, [\n language.data.of({ autocomplete: turtleCompletionSource(options, dialect) }),\n ]);\n}\n\n/** RDF 1.2 Turtle. */\nexport function turtle(options: CompletionOptions = {}): LanguageSupport {\n return support(turtleLanguage, options, 'turtle');\n}\n\n/** RDF 1.2 TriG. */\nexport function trig(options: CompletionOptions = {}): LanguageSupport {\n return support(trigLanguage, options, 'trig');\n}\n\n/**\n * RDF 1.2 N-Triples.\n *\n * A strict subset with its own entry point rather than Turtle in a lenient\n * mood: a prefixed name or a `;` list in an N-Triples document is an error, and\n * an editor that colours it as valid is lying about the file it will write.\n */\nexport function ntriples(): LanguageSupport {\n return new LanguageSupport(ntriplesLanguage);\n}\n\n/** RDF 1.2 N-Quads. */\nexport function nquads(): LanguageSupport {\n return new LanguageSupport(nquadsLanguage);\n}\n"],"names":["parser","t","rawParser"],"mappings":";;;;AAAA;AAEO,MAAMA,QAAM,GAAG,QAAQ,CAAC,WAAW,CAAC;AAC3C,EAAE,OAAO,EAAE,EAAE;AACb,EAAE,MAAM,EAAE,gpDAAgpD;AAC1pD,EAAE,SAAS,EAAE,grCAAgrC;AAC7rC,EAAE,IAAI,EAAE,k8BAAk8B;A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AAoB;AACvE,EAAA,OAAO,OAAA,CAAQ,cAAA,EAAgB,OAAA,EAAS,QAAQ,CAAA;AAClD;AAGO,SAAS,IAAA,CAAK,OAAA,GAA6B,EAAC,EAAoB;AACrE,EAAA,OAAO,OAAA,CAAQ,YAAA,EAAc,OAAA,EAAS,MAAM,CAAA;AAC9C;AASO,SAAS,QAAA,GAA4B;AAC1C,EAAA,OAAO,IAAI,gBAAgB,gBAAgB,CAAA;AAC7C;AAGO,SAAS,MAAA,GAA0B;AACxC,EAAA,OAAO,IAAI,gBAAgB,cAAc,CAAA;AAC3C;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/turtle.grammar","../src/highlight.ts","../src/complete.ts","../src/lint.ts","../src/index.ts"],"sourcesContent":["// This file was generated by lezer-generator. You probably shouldn't edit it.\nimport {LRParser} from \"@lezer/lr\"\nexport const parser = LRParser.deserialize({\n version: 14,\n states: \"5fQYQPOOQ!WQPOOQ!bQPOOQ!bQPOOOOQO'#Ce'#CeOOQO'#EX'#EXO!jQPO'#CaO!oQPO'#CgO!zQPO'#CiO!oQPO'#CkO#PQPO'#CmO#UQPO'#CmOOQO'#C_'#C_OOQO'#Cv'#CvO$[QQO'#C{O$cQPO'#DOO$qQPO'#DbO$cQPO'#CqO%VQPO'#CqOOQO'#EW'#EWO%kQPO'#EWOOQO'#D{'#D{QYQPOOOOQO'#Dn'#DnO%pQPO'#DqO%}QPO'#DlO&`QPO'#DsO&qQPO'#DsO'SQPO'#DtO$cQPO'#DtOOQO'#Ea'#EaOOQO'#E`'#E`OOQO'#EQ'#EQQ!WQPOOOOQO'#Ec'#EcOOQO'#ER'#ERQ!bQPOOO!oQPO'#DvOOQO'#ES'#ESQ!bQPOOO!oQPO'#DyO!oQPO,58{O'eQPO,59RO!oQPO,59TOOQO,59V,59VOOQO,59X,59XO'jQPO,59XOOQO'#D|'#D|O'oQQO,59gOOQO,59g,59gO([QQO'#DPOOQO'#DU'#DUOOQO'#DY'#DYOOQO'#EZ'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#a#jQ#c!zW#w#c#x$[$^Q#x#dQ$[#OR$^$]Q#f!{S#z#f$aR$a$bQqPR!jqQtQR!ktQwRR!mwTeOfWaOfh#PUgPiqQzVQ|X`!X^!Q![#b#y$Y$Z$_h!Y_abjklm!^!x#_#e$`Q!]`Q!luQ!nxQ!oyQ!q{Q!w!WQ#[!uQ#g!|Q#q#]V#s#^#i#{S!P^!QS!z![#yS#O$Y$_Q#v#bR$O$ZR!x!WR#r#]R!^`R#h!|TpPqQ#X!lQ#Y!nR$W$PSuQtSxRwR#l#W\",\n nodeNames: \"⚠ Comment TurtleDoc Directive . PrefixID AtPrefix PNameNS IRIRef PrefixedName PNameLN Base AtBase SparqlPrefix KwPrefix SparqlBase KwBase Version KwVersion VersionSpecifier AtVersion Triples PredicateObjectList Verb KeywordA ObjectList BlankNode BlankNodeLabel Anon ) ( Collection ] [ BlankNodePropertyList RDFLiteral String LangDir Datatype ^^ NumericLiteral Integer Decimal Double BooleanLiteral True False )>> <<( TripleTerm >> << ReifiedTriple Reifier ~ Annotation |} {| AnnotationBlock , ; TrigDoc GraphStatement KwGraph LabelOrSubject } { WrappedGraph TriplesBlock TriplesOrGraph Triples2 NTriplesDoc NTriple NTripleTerm NQuadsDoc NQuad GraphLabel\",\n maxTerm: 99,\n nodeProps: [\n [\"openedBy\", 29,\"(\",32,\"[\",47,\"<<(\",50,\"<<\",56,\"{|\",65,\"{\"],\n [\"closedBy\", 30,\")\",33,\"]\",48,\")>>\",51,\">>\",57,\"|}\",66,\"}\"]\n ],\n skippedNodes: [0,1],\n repeatNodeCount: 8,\n tokenData: \"#-Z~R!]XY$zYZ$z]^$zpq$zrs%]st,]wx,wxy3kyz3p{|4T|}5{}!O4T!O!P6Q!Q![5^![!]6Y!]!^<j!^!_<o!`!aAZ!b!cAf!c!dL|!d!e! s!e!iL|!i!j!(X!j!rL|!r!s!0_!s!xL|!x!y!:]!y!}L|!}#O!E{#P#Q!Fx#Q#R!F}#R#S!GY#T#U!KW#U#V! s#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$JgL|$Kh%#tL|&/x&EtL|&FV;'SL|?&r?AhL|?BY?MnL|~#'|g}!OL|!O!PNb!Q![L|![!]6Y!c!}L|#R#SL|#T#iL|#i#j#)e#j#oL|$}%OL|%W%oL|%p&aL|&b1pL|1p4UL|4U4dL|4e$ISL|$I`$IbL|$Je$JgL|$Kh%#tL|&/x&EtL|&FV;'SL|?&r?AhL|?BY?MnL|~#)hg}!OL|!O!PNb!Q![L|![!]6Y!c!}L|#R#SL|#T#XL|#X#Y#+P#Y#oL|$}%OL|%W%oL|%p&aL|&b1pL|1p4UL|4U4dL|4e$ISL|$I`$IbL|$Je$JgL|$Kh%#tL|&/x&EtL|&FV;'SL|?&r?AhL|?BY?MnL|~#+Ue}~}!OL|!O!PNb!Q![L|![!]6Y!c!}L|#R#SL|#T#oL|$}%OL|%W%oL|%p&aL|&b1pL|1p4UL|4U4dL|4e$ISL|$I`$IbL|$Je$JgL|$Kh%#tL|&/x&EtL|&FV;'SL|?&r?AhL|?BY?MnL|V#,lP!dP#p#q#,oU#,tO!ZU~#,wP#q#r#,z~#-PO!Y~~#-UO!c~~#-ZO!W~\",\n tokenizers: [0, 1, 2],\n topRules: {\"TurtleDoc\":[0,2],\"TrigDoc\":[1,61],\"NTriplesDoc\":[2,71],\"NQuadsDoc\":[3,74]},\n tokenPrec: 931\n})\n","import type { NodePropSource } from '@lezer/common';\nimport { styleTags, tags as t } from '@lezer/highlight';\n\n/**\n * The shared highlight-tag table, Turtle half.\n *\n * `docs/highlight-tags.md` is the canonical table and `test/highlight.test.ts`\n * asserts this against it, so a consumer can keep one `HighlightStyle` for all\n * three languages. Two conventions are worth knowing:\n *\n * - an IRI and a prefixed name are tagged differently (`url` / `namespace`)\n * but denote the same kind of thing, so a style is free to colour them the\n * same — which is what the reference style does;\n * - a datatype IRI is tagged `typeName` rather than `url`, because it\n * qualifies the literal rather than being a term the document is about. The\n * parent-path rules below are more specific than the bare token rules, so\n * they win inside `Datatype`.\n */\nexport const turtleHighlighting: NodePropSource = styleTags({\n Comment: t.comment,\n\n 'AtPrefix AtBase AtVersion KwPrefix KwBase KwGraph KwVersion KeywordA': t.keyword,\n\n IRIRef: t.url,\n 'PNameNS PNameLN': t.namespace,\n\n 'BlankNodeLabel Anon': t.propertyName,\n\n 'String VersionSpecifier': t.string,\n 'Integer Decimal Double': t.number,\n 'True False': t.bool,\n\n LangDir: t.annotation,\n 'Datatype/IRIRef Datatype/PrefixedName/PNameNS Datatype/PrefixedName/PNameLN': t.typeName,\n 'Datatype/\"^^\"': t.typeName,\n\n /*\n * The RDF 1.2 term brackets are tagged apart from ordinary grouping, because\n * `<< s p o >>` and `<<( s p o )>>` differ by one character and mean quite\n * different things — a statement you can refer to, versus an object that *is*\n * a triple. A style that cannot separate them cannot help a reader see that.\n *\n * Each is a `special()` of the standard tag its glyphs actually are, so the\n * fallback chain does the work: a theme that knows nothing about RDF 1.2 and\n * styles `bracket` (or `brace`/`paren`/`angleBracket`) still colours all of\n * them, and one that wants the distinction overrides the specific tag.\n */\n\n /*\n * Every token *inside* an RDF 1.2 nested-triple construct also carries\n * `quote`, so a style can shade the whole thing and not just its brackets —\n * which is what \"colour reified triples differently\" usually means. The\n * `/...` form applies to descendants and *combines* with each token's own\n * tag, so an IRI inside a reified triple is `quote url`, not one or the\n * other. A style that never mentions `quote` sees no change at all.\n *\n * One tag for all three constructs, rather than three: the brackets above\n * already say which kind it is, and a style wanting per-kind regions can add\n * its own props to the exported parser.\n */\n 'ReifiedTriple/... TripleTerm/... NTripleTerm/... AnnotationBlock/...': t.quote,\n\n '\"<<\" \">>\"': t.special(t.angleBracket),\n '\"<<(\" \")>>\"': t.special(t.paren),\n '\"{|\" \"|}\"': t.special(t.brace),\n '\"{\" \"}\"': t.brace,\n '\"[\" \"]\"': t.squareBracket,\n '\"(\" \")\"': t.paren,\n\n // The reifier marker only ever introduces a reifier, so it is worth telling\n // from arithmetic; it falls back to `operator`.\n '\"~\"': t.special(t.operator),\n\n '\";\" \",\"': t.separator,\n '\".\"': t.punctuation,\n});\n","import { syntaxTree } from '@codemirror/language';\nimport type { Completion, CompletionContext, CompletionResult } from '@codemirror/autocomplete';\nimport type { EditorState } from '@codemirror/state';\n\n/** A prefix label (without the colon) mapped to the IRI it expands to. */\nexport type PrefixMap = Record<string, string>;\n\n/** Where `turtle()` and friends may look for prefixes beyond the document. */\nexport type PrefixSource = PrefixMap | ((state: EditorState) => PrefixMap);\n\nexport interface CompletionOptions {\n /**\n * Prefixes the editor should offer even when the document has not declared\n * them — an application's own prefix manager, typically. Document\n * declarations win on conflict, because what the document says is what the\n * document means.\n */\n prefixSource?: PrefixSource;\n}\n\nconst DIRECTIVES = ['@prefix', '@base', 'PREFIX', 'BASE'];\nconst TRIG_DIRECTIVES = [...DIRECTIVES, 'GRAPH'];\nconst TERM_KEYWORDS = ['a', 'true', 'false'];\n\n/** Nodes whose interior is text, not syntax: no completion belongs there. */\nconst INERT = new Set(['Comment', 'String', 'VersionSpecifier', 'IRIRef']);\n\n/**\n * The prefixes declared by the document itself, read from the syntax tree.\n *\n * Both spellings are read — `@prefix ex: <…>` and `PREFIX ex: <…>` — because a\n * document may mix them, and a reader completing `ex:` does not care which one\n * declared it.\n */\nexport function documentPrefixes(state: EditorState): PrefixMap {\n const prefixes: PrefixMap = {};\n const tree = syntaxTree(state);\n tree.iterate({\n enter: (node) => {\n if (node.name !== 'PrefixID' && node.name !== 'SparqlPrefix') return;\n let label: string | null = null;\n let iri: string | null = null;\n for (let child = node.node.firstChild; child; child = child.nextSibling) {\n if (child.name === 'PNameNS' && label === null) {\n label = state.sliceDoc(child.from, child.to).slice(0, -1);\n } else if (child.name === 'IRIRef' && iri === null) {\n iri = state.sliceDoc(child.from + 1, child.to - 1);\n }\n }\n if (label !== null) prefixes[label] = iri ?? '';\n },\n });\n return prefixes;\n}\n\nfunction resolveSource(source: PrefixSource | undefined, state: EditorState): PrefixMap {\n if (!source) return {};\n return typeof source === 'function' ? source(state) : source;\n}\n\n/** Every prefix the editor knows about: the external source, overlaid by the document's. */\nexport function knownPrefixes(state: EditorState, options: CompletionOptions = {}): PrefixMap {\n return { ...resolveSource(options.prefixSource, state), ...documentPrefixes(state) };\n}\n\nfunction prefixCompletions(state: EditorState, options: CompletionOptions): Completion[] {\n const prefixes = knownPrefixes(state, options);\n return Object.entries(prefixes).map(([label, iri]) => ({\n label: `${label}:`,\n type: 'namespace',\n detail: iri || undefined,\n }));\n}\n\nfunction keywordCompletions(words: readonly string[]): Completion[] {\n return words.map((label) => ({ label, type: 'keyword' }));\n}\n\n/**\n * Is the cursor inside a literal or IRI that has not been closed yet?\n *\n * A half-typed `\"some tex` or `<http://ex` never reaches a `String` or\n * `IRIRef` node — it is error debris, and the error node covers only the last\n * word — so the node name cannot answer this. Scanning the line up to the\n * cursor can, and it is the state a reader is in while typing one.\n *\n * Two details earn their place. `<<` is not an IRI, so it does not open one,\n * which keeps completion alive inside a half-typed reified triple. And an IRI\n * cannot contain a space, so whitespace closes the scan rather than\n * suppressing completion for the rest of the line.\n *\n * The scan is line-local, so an unterminated *long* string (`\"\"\"…`) spanning\n * lines is not detected past its first line. Terminated ones are, through the\n * `String` node above.\n */\nfunction inUnterminatedTerm(state: EditorState, pos: number): boolean {\n const line = state.doc.lineAt(pos);\n const text = line.text.slice(0, pos - line.from);\n let quote: string | null = null;\n let angle = false;\n for (let i = 0; i < text.length; i++) {\n const ch = text[i];\n if (quote) {\n if (ch === '\\\\') i++;\n else if (ch === quote) quote = null;\n } else if (angle) {\n if (ch === '>' || ch === ' ' || ch === '\\t') angle = false;\n } else if (ch === '\"' || ch === \"'\") {\n quote = ch;\n } else if (ch === '<' && text[i + 1] !== '<') {\n angle = true;\n }\n }\n return quote !== null || angle;\n}\n\n/**\n * Completion for Turtle-family documents.\n *\n * Deliberately context-light: it offers directives, the three term keywords and\n * the document's prefixes wherever a word is being typed, rather than trying to\n * work out whether the cursor is in a subject or an object position. In an\n * error-tolerant tree a half-typed statement usually has no reliable position\n * to read, and a wrong context is worse than a slightly long list.\n */\nexport function turtleCompletionSource(\n options: CompletionOptions = {},\n dialect: 'turtle' | 'trig' = 'turtle'\n) {\n return (context: CompletionContext): CompletionResult | null => {\n const word = context.matchBefore(/[@A-Za-z_][\\w.-]*:?/);\n if (!word && !context.explicit) return null;\n const from = word ? word.from : context.pos;\n\n const node = syntaxTree(context.state).resolveInner(context.pos, -1);\n if (INERT.has(node.name)) return null;\n if (inUnterminatedTerm(context.state, context.pos)) return null;\n\n const directives = dialect === 'trig' ? TRIG_DIRECTIVES : DIRECTIVES;\n return {\n from,\n options: [\n ...keywordCompletions(directives),\n ...keywordCompletions(TERM_KEYWORDS),\n ...prefixCompletions(context.state, options),\n ],\n validFor: /^[@A-Za-z_][\\w.-]*:?$/,\n };\n };\n}\n","import { ensureSyntaxTree } from '@codemirror/language';\nimport { linter } from '@codemirror/lint';\nimport type { EditorState, Extension } from '@codemirror/state';\n\nexport interface ParseError {\n from: number;\n to: number;\n message: string;\n}\n\n/**\n * How long to spend completing the parse before reporting errors. A partial\n * tree ends in error nodes that are not in the document, so nothing is\n * reported until the parse reaches the end.\n */\nconst PARSE_TIMEOUT_MS = 1000;\n\n/** Whitespace and `#` comments: what may separate error nodes in one run. */\nconst GAP = /^(?:\\s|#.*)*$/;\n\n/**\n * Every parse error in the document.\n *\n * The parser recovers by skipping one token at a time, so `this is a test`\n * produces four error nodes. Nodes separated only by whitespace or comments are\n * merged into one error.\n */\nexport function parseErrors(state: EditorState): ParseError[] {\n const tree = ensureSyntaxTree(state, state.doc.length, PARSE_TIMEOUT_MS);\n if (!tree) return [];\n const runs: { from: number; to: number }[] = [];\n tree.iterate({\n enter: (node) => {\n if (!node.type.isError) return;\n const last = runs[runs.length - 1];\n if (last && (node.from <= last.to || GAP.test(state.sliceDoc(last.to, node.from))))\n last.to = Math.max(last.to, node.to);\n else runs.push({ from: node.from, to: node.to });\n },\n });\n return runs.map(({ from, to }) => ({ from, to, message: errorMessage(state.sliceDoc(from, to)) }));\n}\n\nfunction errorMessage(text: string): string {\n const shown = text.replace(/\\s+/g, ' ').trim();\n if (!shown) return 'Syntax error.';\n return `Unexpected “${shown.length > 32 ? `${shown.slice(0, 32)}…` : shown}”.`;\n}\n\n/** Underline every parse error. Included in `turtle()`, `trig()`, `ntriples()` and `nquads()`. */\nexport function parseErrorLinter(): Extension {\n return linter((view) => parseErrors(view.state).map((error) => ({ ...error, severity: 'error' })));\n}\n","import type { SyntaxNode } from '@lezer/common';\nimport type { EditorState } from '@codemirror/state';\nimport {\n LRLanguage,\n LanguageSupport,\n delimitedIndent,\n foldInside,\n foldNodeProp,\n indentNodeProp,\n syntaxTree,\n} from '@codemirror/language';\nimport type { LRParser } from '@lezer/lr';\nimport { parser as rawParser } from './turtle.grammar';\nimport { turtleHighlighting } from './highlight';\nimport { turtleCompletionSource } from './complete';\nimport type { CompletionOptions } from './complete';\nimport { parseErrorLinter } from './lint';\n\nexport type { CompletionOptions, PrefixMap, PrefixSource } from './complete';\nexport { documentPrefixes, knownPrefixes, turtleCompletionSource } from './complete';\nexport { turtleHighlighting } from './highlight';\nexport { parseErrorLinter, parseErrors } from './lint';\nexport type { ParseError } from './lint';\n\n/** The unconfigured grammar, for callers that want their own `top` or props. */\nexport const parser: LRParser = rawParser;\n\n/**\n * Fold a whole statement from the end of its first line.\n *\n * This is the one fold in Turtle with no brackets around it: a subject with a\n * long `;` list is the common shape a reader wants collapsed, and the structure\n * that shape has is a statement, not a delimiter.\n *\n * It stands aside when a bracket opens on the same line. Folding\n * `ex:s ex:p [` at the statement level would hide the `] .` as well, leaving\n * what is left looking unterminated; the bracket's own fold — which CodeMirror\n * would otherwise never reach, since the statement node encloses it — reads\n * correctly.\n */\nconst statementFold = (node: SyntaxNode, state: EditorState) => {\n const firstLineEnd = state.doc.lineAt(node.from).to;\n if (node.to <= firstLineEnd) return null;\n for (let n: SyntaxNode | null = syntaxTree(state).resolveInner(firstLineEnd, -1); n; n = n.parent) {\n if (n.from < node.from) break;\n if (n.type.prop(foldNodeProp) && n.from <= firstLineEnd && n.to > firstLineEnd && n.type !== node.type) return null;\n }\n return { from: firstLineEnd, to: node.to };\n};\n\n/**\n * Highlighting, folding and indentation, shared by all four dialects.\n *\n * Exported so a consumer can re-configure the parser with props of their own —\n * extra `styleTags`, say, to tag the three RDF 1.2 constructs' regions apart\n * rather than all as `quote`. `codemirror-lang-sparql12` exports `sparqlProps`\n * for the same reason.\n */\nexport const turtleProps = [\n turtleHighlighting,\n indentNodeProp.add({\n BlankNodePropertyList: delimitedIndent({ closing: ']' }),\n Collection: delimitedIndent({ closing: ')' }),\n WrappedGraph: delimitedIndent({ closing: '}' }),\n AnnotationBlock: delimitedIndent({ closing: '|}' }),\n TripleTerm: delimitedIndent({ closing: ')>>' }),\n ReifiedTriple: delimitedIndent({ closing: '>>' }),\n }),\n foldNodeProp.add({\n BlankNodePropertyList: foldInside,\n Collection: foldInside,\n WrappedGraph: foldInside,\n AnnotationBlock: foldInside,\n 'Triples Triples2 TriplesOrGraph': statementFold,\n }),\n];\n\nconst languageData = {\n commentTokens: { line: '#' },\n closeBrackets: { brackets: ['[', '(', '<', '\"', \"'\"] },\n indentOnInput: /^\\s*[\\]})]$/,\n};\n\nfunction define(top: string) {\n return LRLanguage.define({\n name: top === 'TurtleDoc' ? 'turtle' : top === 'TrigDoc' ? 'trig' : top === 'NTriplesDoc' ? 'ntriples' : 'nquads',\n parser: rawParser.configure({ top, props: turtleProps }),\n languageData,\n });\n}\n\nexport const turtleLanguage = define('TurtleDoc');\nexport const trigLanguage = define('TrigDoc');\nexport const ntriplesLanguage = define('NTriplesDoc');\nexport const nquadsLanguage = define('NQuadsDoc');\n\nfunction support(language: LRLanguage, options: CompletionOptions, dialect: 'turtle' | 'trig') {\n return new LanguageSupport(language, [\n language.data.of({ autocomplete: turtleCompletionSource(options, dialect) }),\n parseErrorLinter(),\n ]);\n}\n\n/** RDF 1.2 Turtle. */\nexport function turtle(options: CompletionOptions = {}): LanguageSupport {\n return support(turtleLanguage, options, 'turtle');\n}\n\n/** RDF 1.2 TriG. */\nexport function trig(options: CompletionOptions = {}): LanguageSupport {\n return support(trigLanguage, options, 'trig');\n}\n\n/**\n * RDF 1.2 N-Triples.\n *\n * A strict subset with its own entry point rather than Turtle in a lenient\n * mood: a prefixed name or a `;` list in an N-Triples document is an error, and\n * an editor that colours it as valid is lying about the file it will write.\n */\nexport function ntriples(): LanguageSupport {\n return new LanguageSupport(ntriplesLanguage, parseErrorLinter());\n}\n\n/** RDF 1.2 N-Quads. */\nexport function nquads(): LanguageSupport {\n return new LanguageSupport(nquadsLanguage, parseErrorLinter());\n}\n"],"names":["parser","t","rawParser"],"mappings":";;;;;AAAA;AAEO,MAAMA,QAAM,GAAG,QAAQ,CAAC,WAAW,CAAC;AAC3C,EAAE,OAAO,EAAE,EAAE;AACb,EAAE,MAAM,EAAE,gpDAAgpD;AAC1pD,EAAE,SAAS,EAAE,grCAAgrC;AAC7rC,EAAE,IAAI,EAAE,k8BAAk8B;AAC18B,EAAE,SAAS,EAAE,+oBAA+oB;AAC5pB,EAAE,OAAO,EAAE,EAAE;AACb,EAAE,SAAS,EAAE;AACb,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC;AAC/D,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG;AAC9D,GAAG;AACH,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACrB,EAAE,eAAe,EAAE,CAAC;AACpB,EAAE,SAAS,EAAE,+gTAA+gT;AAC5hT,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACv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AS,MAAM,CAAA;AAC9C;AASO,SAAS,QAAA,GAA4B;AAC1C,EAAA,OAAO,IAAI,eAAA,CAAgB,gBAAA,EAAkB,gBAAA,EAAkB,CAAA;AACjE;AAGO,SAAS,MAAA,GAA0B;AACxC,EAAA,OAAO,IAAI,eAAA,CAAgB,cAAA,EAAgB,gBAAA,EAAkB,CAAA;AAC/D;;"}
|
package/dist/lint.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { EditorState, Extension } from '@codemirror/state';
|
|
2
|
+
export interface ParseError {
|
|
3
|
+
from: number;
|
|
4
|
+
to: number;
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Every parse error in the document.
|
|
9
|
+
*
|
|
10
|
+
* The parser recovers by skipping one token at a time, so `this is a test`
|
|
11
|
+
* produces four error nodes. Nodes separated only by whitespace or comments are
|
|
12
|
+
* merged into one error.
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseErrors(state: EditorState): ParseError[];
|
|
15
|
+
/** Underline every parse error. Included in `turtle()`, `trig()`, `ntriples()` and `nquads()`. */
|
|
16
|
+
export declare function parseErrorLinter(): Extension;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kurrawongai/codemirror-lang-turtle12",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "RDF 1.2 Turtle, TriG, N-Triples and N-Quads language support for CodeMirror 6",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@codemirror/autocomplete": "^6.18.0",
|
|
44
44
|
"@codemirror/language": "^6.10.0",
|
|
45
|
+
"@codemirror/lint": "^6.8.5",
|
|
45
46
|
"@codemirror/state": "^6.4.0",
|
|
46
47
|
"@lezer/common": "^1.2.0",
|
|
47
48
|
"@lezer/highlight": "^1.2.0",
|
package/src/index.ts
CHANGED
|
@@ -14,10 +14,13 @@ import { parser as rawParser } from './turtle.grammar';
|
|
|
14
14
|
import { turtleHighlighting } from './highlight';
|
|
15
15
|
import { turtleCompletionSource } from './complete';
|
|
16
16
|
import type { CompletionOptions } from './complete';
|
|
17
|
+
import { parseErrorLinter } from './lint';
|
|
17
18
|
|
|
18
19
|
export type { CompletionOptions, PrefixMap, PrefixSource } from './complete';
|
|
19
20
|
export { documentPrefixes, knownPrefixes, turtleCompletionSource } from './complete';
|
|
20
21
|
export { turtleHighlighting } from './highlight';
|
|
22
|
+
export { parseErrorLinter, parseErrors } from './lint';
|
|
23
|
+
export type { ParseError } from './lint';
|
|
21
24
|
|
|
22
25
|
/** The unconfigured grammar, for callers that want their own `top` or props. */
|
|
23
26
|
export const parser: LRParser = rawParser;
|
|
@@ -94,6 +97,7 @@ export const nquadsLanguage = define('NQuadsDoc');
|
|
|
94
97
|
function support(language: LRLanguage, options: CompletionOptions, dialect: 'turtle' | 'trig') {
|
|
95
98
|
return new LanguageSupport(language, [
|
|
96
99
|
language.data.of({ autocomplete: turtleCompletionSource(options, dialect) }),
|
|
100
|
+
parseErrorLinter(),
|
|
97
101
|
]);
|
|
98
102
|
}
|
|
99
103
|
|
|
@@ -115,10 +119,10 @@ export function trig(options: CompletionOptions = {}): LanguageSupport {
|
|
|
115
119
|
* an editor that colours it as valid is lying about the file it will write.
|
|
116
120
|
*/
|
|
117
121
|
export function ntriples(): LanguageSupport {
|
|
118
|
-
return new LanguageSupport(ntriplesLanguage);
|
|
122
|
+
return new LanguageSupport(ntriplesLanguage, parseErrorLinter());
|
|
119
123
|
}
|
|
120
124
|
|
|
121
125
|
/** RDF 1.2 N-Quads. */
|
|
122
126
|
export function nquads(): LanguageSupport {
|
|
123
|
-
return new LanguageSupport(nquadsLanguage);
|
|
127
|
+
return new LanguageSupport(nquadsLanguage, parseErrorLinter());
|
|
124
128
|
}
|
package/src/lint.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ensureSyntaxTree } from '@codemirror/language';
|
|
2
|
+
import { linter } from '@codemirror/lint';
|
|
3
|
+
import type { EditorState, Extension } from '@codemirror/state';
|
|
4
|
+
|
|
5
|
+
export interface ParseError {
|
|
6
|
+
from: number;
|
|
7
|
+
to: number;
|
|
8
|
+
message: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* How long to spend completing the parse before reporting errors. A partial
|
|
13
|
+
* tree ends in error nodes that are not in the document, so nothing is
|
|
14
|
+
* reported until the parse reaches the end.
|
|
15
|
+
*/
|
|
16
|
+
const PARSE_TIMEOUT_MS = 1000;
|
|
17
|
+
|
|
18
|
+
/** Whitespace and `#` comments: what may separate error nodes in one run. */
|
|
19
|
+
const GAP = /^(?:\s|#.*)*$/;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Every parse error in the document.
|
|
23
|
+
*
|
|
24
|
+
* The parser recovers by skipping one token at a time, so `this is a test`
|
|
25
|
+
* produces four error nodes. Nodes separated only by whitespace or comments are
|
|
26
|
+
* merged into one error.
|
|
27
|
+
*/
|
|
28
|
+
export function parseErrors(state: EditorState): ParseError[] {
|
|
29
|
+
const tree = ensureSyntaxTree(state, state.doc.length, PARSE_TIMEOUT_MS);
|
|
30
|
+
if (!tree) return [];
|
|
31
|
+
const runs: { from: number; to: number }[] = [];
|
|
32
|
+
tree.iterate({
|
|
33
|
+
enter: (node) => {
|
|
34
|
+
if (!node.type.isError) return;
|
|
35
|
+
const last = runs[runs.length - 1];
|
|
36
|
+
if (last && (node.from <= last.to || GAP.test(state.sliceDoc(last.to, node.from))))
|
|
37
|
+
last.to = Math.max(last.to, node.to);
|
|
38
|
+
else runs.push({ from: node.from, to: node.to });
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
return runs.map(({ from, to }) => ({ from, to, message: errorMessage(state.sliceDoc(from, to)) }));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function errorMessage(text: string): string {
|
|
45
|
+
const shown = text.replace(/\s+/g, ' ').trim();
|
|
46
|
+
if (!shown) return 'Syntax error.';
|
|
47
|
+
return `Unexpected “${shown.length > 32 ? `${shown.slice(0, 32)}…` : shown}”.`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Underline every parse error. Included in `turtle()`, `trig()`, `ntriples()` and `nquads()`. */
|
|
51
|
+
export function parseErrorLinter(): Extension {
|
|
52
|
+
return linter((view) => parseErrors(view.state).map((error) => ({ ...error, severity: 'error' })));
|
|
53
|
+
}
|