@traqula/rules-sparql-1-2 1.1.3 → 1.1.4
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.
|
@@ -28,7 +28,7 @@ function completeParseContext(context) {
|
|
|
28
28
|
return {
|
|
29
29
|
astFactory: context.astFactory ?? new AstFactory_js_1.AstFactory({ tracksSourceLocation: false }),
|
|
30
30
|
baseIRI: context.baseIRI,
|
|
31
|
-
prefixes:
|
|
31
|
+
prefixes: Object.assign(Object.create(null), context.prefixes),
|
|
32
32
|
parseMode: context.parseMode ? new Set(context.parseMode) : new Set(['canParseVars', 'canCreateBlankNodes']),
|
|
33
33
|
skipValidation: context.skipValidation ?? false,
|
|
34
34
|
codepointEscape: context.codepointEscape ?? sparql12CodepointEscape,
|
|
@@ -47,7 +47,7 @@ function completeGeneratorContext(context) {
|
|
|
47
47
|
function copyParseContext(context) {
|
|
48
48
|
return {
|
|
49
49
|
...context,
|
|
50
|
-
prefixes:
|
|
50
|
+
prefixes: Object.assign(Object.create(null), context.prefixes),
|
|
51
51
|
parseMode: new Set(context.parseMode),
|
|
52
52
|
};
|
|
53
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parserUtils.js","sourceRoot":"","sources":["../../../lib/parserUtils.ts"],"names":[],"mappings":";;;AAYA,0DAYC;AAED,oDAWC;AAED,4DAWC;AAED,4CASC;AA7DD,wCAAmG;AACnG,mDAA6C;AAI7C;;;;;;GAMG;AACH,SAAgB,uBAAuB,CAAC,KAAa;IACnD,OAAO,KAAK,CAAC,UAAU,CACrB,2CAA2C,EAC3C,CAAC,CAAC,EAAE,QAA4B,EAAE,QAA4B,EAAE,EAAE;QAChE,MAAM,GAAG,GAAG,CAAC,QAAQ,IAAI,QAAQ,CAAE,CAAC;QACpC,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC3C,IAAI,SAAS,IAAI,MAAM,IA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traqulaIndentation, traqulaNewlineAlternative } from '@traqula/core';\nimport { AstFactory } from './AstFactory.js';\nimport type { SparqlContext, SparqlGeneratorContext } from './sparql12HelperTypes.js';\nimport type { Sparql12Nodes } from './sparql12Types.js';\n\n/**\n * Decode UCHAR codepoint escapes (\\\\uXXXX / \\\\UXXXXXXXX) within a string according to\n * [SPARQL 1.2 §19.2](https://www.w3.org/TR/sparql12-query/#sec-escapes).\n *\n * Unlike the SPARQL 1.1 variant, this function rejects surrogate code points (U+D800–U+DFFF)\n * even when they would form a valid surrogate pair.\n */\nexport function sparql12CodepointEscape(input: string): string {\n return input.replaceAll(\n /\\\\u([0-9a-fA-F]{4})|\\\\U([0-9a-fA-F]{8})/gu,\n (_, unicode4: string | undefined, unicode8: string | undefined) => {\n const hex = (unicode4 ?? unicode8)!;\n const codePoint = Number.parseInt(hex, 16);\n if (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\n throw new Error(`Illegal codepoint escape: surrogate code point U+${hex.toUpperCase()}`);\n }\n return String.fromCodePoint(codePoint);\n },\n );\n}\n\nexport function completeParseContext(\n context: Partial<SparqlContext>,\n): SparqlContext {\n return {\n astFactory: context.astFactory ?? new AstFactory({ tracksSourceLocation: false }),\n baseIRI: context.baseIRI,\n prefixes: Object.assign(Object.create(null), context.prefixes),\n parseMode: context.parseMode ? new Set(context.parseMode) : new Set([ 'canParseVars', 'canCreateBlankNodes' ]),\n skipValidation: context.skipValidation ?? false,\n codepointEscape: context.codepointEscape ?? sparql12CodepointEscape,\n };\n}\n\nexport function completeGeneratorContext(\n context: Partial<SparqlGeneratorContext & { offset?: number }>,\n): SparqlGeneratorContext & { offset?: number } {\n return {\n astFactory: context.astFactory ?? new AstFactory(),\n origSource: context.origSource ?? '',\n offset: context.offset,\n indentInc: context.indentInc ?? 2,\n [traqulaIndentation]: context[traqulaIndentation] ?? 0,\n [traqulaNewlineAlternative]: context[traqulaNewlineAlternative] ?? ' ',\n };\n}\n\nexport function copyParseContext<T extends\nPartial<SparqlContext & SparqlGeneratorContext & { origSource: string; offset?: number }>>(\n context: T,\n): T {\n return {\n ...context,\n prefixes: Object.assign(Object.create(null), context.prefixes),\n parseMode: new Set(context.parseMode),\n };\n}\n\nexport class AstTransformer extends TransformerSubTyped<Sparql12Nodes> {}\n"]}
|
|
@@ -21,7 +21,7 @@ export function completeParseContext(context) {
|
|
|
21
21
|
return {
|
|
22
22
|
astFactory: context.astFactory ?? new AstFactory({ tracksSourceLocation: false }),
|
|
23
23
|
baseIRI: context.baseIRI,
|
|
24
|
-
prefixes:
|
|
24
|
+
prefixes: Object.assign(Object.create(null), context.prefixes),
|
|
25
25
|
parseMode: context.parseMode ? new Set(context.parseMode) : new Set(['canParseVars', 'canCreateBlankNodes']),
|
|
26
26
|
skipValidation: context.skipValidation ?? false,
|
|
27
27
|
codepointEscape: context.codepointEscape ?? sparql12CodepointEscape,
|
|
@@ -40,7 +40,7 @@ export function completeGeneratorContext(context) {
|
|
|
40
40
|
export function copyParseContext(context) {
|
|
41
41
|
return {
|
|
42
42
|
...context,
|
|
43
|
-
prefixes:
|
|
43
|
+
prefixes: Object.assign(Object.create(null), context.prefixes),
|
|
44
44
|
parseMode: new Set(context.parseMode),
|
|
45
45
|
};
|
|
46
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parserUtils.js","sourceRoot":"","sources":["../../../lib/parserUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI7C;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAa;IACnD,OAAO,KAAK,CAAC,UAAU,CACrB,2CAA2C,EAC3C,CAAC,CAAC,EAAE,QAA4B,EAAE,QAA4B,EAAE,EAAE;QAChE,MAAM,GAAG,GAAG,CAAC,QAAQ,IAAI,QAAQ,CAAE,CAAC;QACpC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,QAAQ,CAAC;QAC9D,SAAS,EAAE,IAAI,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC;KACtC,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,cAAe,SAAQ,mBAAkC;CAAG","sourcesContent":["import { TransformerSubTyped, traqulaIndentation, traqulaNewlineAlternative } from '@traqula/core';\nimport { AstFactory } from './AstFactory.js';\nimport type { SparqlContext, SparqlGeneratorContext } from './sparql12HelperTypes.js';\nimport type { Sparql12Nodes } from './sparql12Types.js';\n\n/**\n * Decode UCHAR codepoint escapes (\\\\uXXXX / \\\\UXXXXXXXX) within a string according to\n * [SPARQL 1.2 §19.2](https://www.w3.org/TR/sparql12-query/#sec-escapes).\n *\n * Unlike the SPARQL 1.1 variant, this function rejects surrogate code points (U+D800–U+DFFF)\n * even when they would form a valid surrogate pair.\n */\nexport function sparql12CodepointEscape(input: string): string {\n return input.replaceAll(\n /\\\\u([0-9a-fA-F]{4})|\\\\U([0-9a-fA-F]{8})/gu,\n (_, unicode4: string | undefined, unicode8: string | undefined) => {\n const hex = (unicode4 ?? unicode8)!;\n const codePoint = Number.parseInt(hex, 16);\n if (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\n throw new Error(`Illegal codepoint escape: surrogate code point U+${hex.toUpperCase()}`);\n }\n return String.fromCodePoint(codePoint);\n },\n );\n}\n\nexport function completeParseContext(\n context: Partial<SparqlContext>,\n): SparqlContext {\n return {\n astFactory: context.astFactory ?? new AstFactory({ tracksSourceLocation: false }),\n baseIRI: context.baseIRI,\n prefixes: Object.assign(Object.create(null), context.prefixes),\n parseMode: context.parseMode ? new Set(context.parseMode) : new Set([ 'canParseVars', 'canCreateBlankNodes' ]),\n skipValidation: context.skipValidation ?? false,\n codepointEscape: context.codepointEscape ?? sparql12CodepointEscape,\n };\n}\n\nexport function completeGeneratorContext(\n context: Partial<SparqlGeneratorContext & { offset?: number }>,\n): SparqlGeneratorContext & { offset?: number } {\n return {\n astFactory: context.astFactory ?? new AstFactory(),\n origSource: context.origSource ?? '',\n offset: context.offset,\n indentInc: context.indentInc ?? 2,\n [traqulaIndentation]: context[traqulaIndentation] ?? 0,\n [traqulaNewlineAlternative]: context[traqulaNewlineAlternative] ?? ' ',\n };\n}\n\nexport function copyParseContext<T extends\nPartial<SparqlContext & SparqlGeneratorContext & { origSource: string; offset?: number }>>(\n context: T,\n): T {\n return {\n ...context,\n prefixes: Object.assign(Object.create(null), context.prefixes),\n parseMode: new Set(context.parseMode),\n };\n}\n\nexport class AstTransformer extends TransformerSubTyped<Sparql12Nodes> {}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@traqula/rules-sparql-1-2",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.4",
|
|
5
5
|
"description": "Traqula Lexer and Grammar Rules for sparql 1.2",
|
|
6
6
|
"lsd:module": true,
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"build:cjs": "node \"../../node_modules/typescript/bin/tsc\" -b tsconfig.cjs.json"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@traqula/core": "^1.1.
|
|
45
|
-
"@traqula/rules-sparql-1-1": "^1.1.
|
|
44
|
+
"@traqula/core": "^1.1.4",
|
|
45
|
+
"@traqula/rules-sparql-1-1": "^1.1.4"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "b16440712fc8cd970b190900e7eb3e16fbd7f6e7"
|
|
48
48
|
}
|