@traqula/parser-sparql-1-1-adjust 0.0.3 → 0.0.5
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 +0 -2
- package/lib/Parser.d.ts +152 -152
- package/lib/Parser.js +9 -15
- package/lib/Parser.js.map +1 -1
- package/lib/index.cjs +1643 -1643
- package/package.json +8 -8
package/lib/Parser.js
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import { ParserBuilder, LexerBuilder } from '@traqula/core';
|
|
2
2
|
import { sparql11ParserBuilder } from '@traqula/parser-sparql-1-1';
|
|
3
|
-
import { sparqlCodepointEscape, lex as l11,
|
|
3
|
+
import { sparqlCodepointEscape, lex as l11, MinimalSparqlParser } from '@traqula/rules-sparql-1-1';
|
|
4
4
|
import { gram, lex } from '@traqula/rules-sparql-1-1-adjust';
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
{ ALT: () => SUBRULE(gram.builtInAdjust, undefined) },
|
|
9
|
-
{ ALT: () => SUBRULE(gram.existingBuildInCall, undefined) },
|
|
10
|
-
]),
|
|
11
|
-
};
|
|
12
|
-
export const adjustBuilder = ParserBuilder.create(sparql11ParserBuilder)
|
|
5
|
+
export const adjustParserBuilder = ParserBuilder.create(sparql11ParserBuilder)
|
|
6
|
+
// This typePatch is not needed, but we need to import g11 for our types
|
|
7
|
+
.typePatch()
|
|
13
8
|
.addRule(gram.builtInAdjust)
|
|
14
|
-
.
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
export class Parser extends SparqlParser {
|
|
9
|
+
.patchRule(gram.builtInPatch);
|
|
10
|
+
export const adjustLexerBuilder = LexerBuilder.create(l11.sparql11LexerBuilder).addBefore(l11.a, lex.BuiltInAdjust);
|
|
11
|
+
export class Parser extends MinimalSparqlParser {
|
|
18
12
|
constructor() {
|
|
19
|
-
const parser =
|
|
20
|
-
tokenVocabulary:
|
|
13
|
+
const parser = adjustParserBuilder.build({
|
|
14
|
+
tokenVocabulary: adjustLexerBuilder.tokenVocabulary,
|
|
21
15
|
queryPreProcessor: sparqlCodepointEscape,
|
|
22
16
|
});
|
|
23
17
|
super(parser);
|
package/lib/Parser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Parser.js","sourceRoot":"","sources":["Parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,qBAAqB,EAAE,GAAG,IAAI,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"Parser.js","sourceRoot":"","sources":["Parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,qBAAqB,EAAE,GAAG,IAAI,GAAG,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACnG,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAE7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC,MAAM,CAAC,qBAAqB,CAAC;IAC5E,wEAAwE;KACvE,SAAS,EAAoC;KAC7C,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC;KAC3B,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAIhC,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;AAEpH,MAAM,OAAO,MAAO,SAAQ,mBAAgC;IAC1D;QACE,MAAM,MAAM,GAAmB,mBAAmB,CAAC,KAAK,CAAC;YACvD,eAAe,EAAE,kBAAkB,CAAC,eAAe;YACnD,iBAAiB,EAAE,qBAAqB;SACzC,CAAC,CAAC;QACH,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;CACF","sourcesContent":["import { ParserBuilder, LexerBuilder } from '@traqula/core';\nimport { sparql11ParserBuilder } from '@traqula/parser-sparql-1-1';\nimport type { gram as g11, SparqlQuery } from '@traqula/rules-sparql-1-1';\nimport { sparqlCodepointEscape, lex as l11, MinimalSparqlParser } from '@traqula/rules-sparql-1-1';\nimport { gram, lex } from '@traqula/rules-sparql-1-1-adjust';\n\nexport const adjustParserBuilder = ParserBuilder.create(sparql11ParserBuilder)\n // This typePatch is not needed, but we need to import g11 for our types\n .typePatch<{ [g11.builtInCall.name]: [any]}>()\n .addRule(gram.builtInAdjust)\n .patchRule(gram.builtInPatch);\n\nexport type Adjust11Parser = ReturnType<typeof adjustParserBuilder.build>;\n\nexport const adjustLexerBuilder = LexerBuilder.create(l11.sparql11LexerBuilder).addBefore(l11.a, lex.BuiltInAdjust);\n\nexport class Parser extends MinimalSparqlParser<SparqlQuery> {\n public constructor() {\n const parser: Adjust11Parser = adjustParserBuilder.build({\n tokenVocabulary: adjustLexerBuilder.tokenVocabulary,\n queryPreProcessor: sparqlCodepointEscape,\n });\n super(parser);\n }\n}\n"]}
|