@traqula/rules-sparql-1-2 0.0.1-alpha.176 → 0.0.1-alpha.9
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/lib/Factory.d.ts +18 -0
- package/lib/Factory.js +73 -0
- package/lib/Factory.js.map +1 -0
- package/lib/grammar.d.ts +88 -96
- package/lib/grammar.js +269 -169
- package/lib/grammar.js.map +1 -1
- package/lib/index.cjs +3415 -2286
- package/lib/index.d.ts +4 -1
- package/lib/index.js +4 -1
- package/lib/index.js.map +1 -1
- package/lib/lexer.d.ts +2 -1
- package/lib/lexer.js +2 -1
- package/lib/lexer.js.map +1 -1
- package/lib/parserUtils.d.ts +8 -0
- package/lib/parserUtils.js +13 -0
- package/lib/parserUtils.js.map +1 -0
- package/lib/sparql12HelperTypes.d.ts +50 -0
- package/lib/sparql12HelperTypes.js +2 -0
- package/lib/sparql12HelperTypes.js.map +1 -0
- package/lib/sparql12Types.d.ts +299 -140
- package/lib/sparql12Types.js.map +1 -1
- package/lib/validator.d.ts +2 -0
- package/lib/validator.js +17 -0
- package/lib/validator.js.map +1 -0
- package/package.json +4 -7
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export * as gram from './grammar';
|
|
2
2
|
export * as lex from './lexer';
|
|
3
|
-
export *
|
|
3
|
+
export * from './sparql12Types';
|
|
4
|
+
export * from './sparql12HelperTypes';
|
|
5
|
+
export * from './parserUtils';
|
|
6
|
+
export * from './Factory';
|
|
4
7
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,GAAG,MAAM,SAAS,CAAC;AAC/B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,GAAG,MAAM,SAAS,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC","sourcesContent":["export * as gram from './grammar';\nexport * as lex from './lexer';\nexport * from './sparql12Types';\nexport * from './sparql12HelperTypes';\nexport * from './parserUtils';\nexport * from './Factory';\n"]}
|
package/lib/lexer.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LexerBuilder } from '@traqula/core';
|
|
2
|
+
export declare const version: import("@traqula/core").NamedToken<"Version">;
|
|
2
3
|
export declare const tilde: import("@traqula/core").NamedToken<"Tilde">;
|
|
3
4
|
export declare const annotationOpen: import("@traqula/core").NamedToken<"AnnotationOpen">;
|
|
4
5
|
export declare const annotationClose: import("@traqula/core").NamedToken<"AnnotationClose">;
|
|
@@ -16,4 +17,4 @@ export declare const builtinSUBJECT: import("@traqula/core").NamedToken<"BuiltIn
|
|
|
16
17
|
export declare const builtinPREDICATE: import("@traqula/core").NamedToken<"BuiltInPredicate">;
|
|
17
18
|
export declare const builtinOBJECT: import("@traqula/core").NamedToken<"BuiltInObject">;
|
|
18
19
|
export declare const LANG_DIR: import("@traqula/core").NamedToken<"LANG_DIR">;
|
|
19
|
-
export declare const sparql12Tokens: LexerBuilder<"a" | "BuiltInStr" | "BuiltInLang" | "BuiltInLangmatches" | "BuiltInDatatype" | "BuiltInBound" | "BuiltInIri" | "BuiltInUri" | "BuiltInBnode" | "BuiltInRand" | "BuiltInAbs" | "BuiltInCeil" | "BuiltInFloor" | "BuiltInRound" | "BuiltInConcat" | "BuiltInStrlen" | "BuiltInUcase" | "BuiltInLcase" | "BuiltInEncode_for_uri" | "BuiltInContains" | "BuiltInStrstarts" | "BuiltInStrends" | "BuiltInStrbefore" | "BuiltInStrafter" | "BuiltInYear" | "BuiltInMonth" | "BuiltInDay" | "BuiltInHours" | "BuiltInMinutes" | "BuiltInSeconds" | "BuiltInTimezone" | "BuiltInTz" | "BuiltInNow" | "BuiltInUuid" | "BuiltInStruuid" | "BuiltInMd5" | "BuiltInSha1" | "BuiltInSha256" | "BuiltInSha384" | "BuiltInSha512" | "BuiltInCoalesce" | "BuiltInIf" | "BuiltInStrlang" | "BuiltInStrdt" | "BuiltInSameterm" | "BuiltInIsiri" | "BuiltInIsuri" | "BuiltInIsblank" | "BuiltInIsliteral" | "BuiltInIsnumeric" | "BuiltInRegex" | "BuiltInSubstr" | "BuiltInReplace" | "BuiltInExists" | "BuiltInNotexists" | "BuiltInCount" | "BuiltInSum" | "BuiltInMin" | "BuiltInMax" | "BuiltInAvg" | "BuiltInSample" | "BuiltInGroup_concat" | "NamedGraph" | "DefaultGraph" | "Graph" | "GraphAll" | "LCurly" | "RCurly" | "Dot" | "Comma" | "Semi" | "LParen" | "RParen" | "LSquare" | "RSquare" | "Pipe" | "Slash" | "Hat" | "Question" | "Star" | "OpPlus" | "OpMinus" | "Exclamation" | "LogicAnd" | "LogicOr" | "Equal" | "NotEqual" | "LessThan" | "GreaterThan" | "LessThanEqual" | "GreaterThanEqual" | "Hathat" | "IriRef" | "PNameLn" | "PNameNs" | "BlankNodeLabel" | "Var1" | "Var2" | "Integer" | "Decimal" | "Double" | "InterferePositive" | "DecimalPositive" | "DoublePositive" | "IntegerNegative" | "DecimalNegative" | "DoubleNegative" | "StringLiteral1" | "StringLiteral2" | "StringLiteralLong1" | "StringLiteralLong2" | "Ws" | "Comment" | "Nil" | "Anon" | "BaseDecl" | "PrefixDecl" | "Select" | "Distinct" | "Reduced" | "As" | "Construct" | "Describe" | "Ask" | "From" | "Where" | "
|
|
20
|
+
export declare const sparql12Tokens: LexerBuilder<"a" | "BuiltInStr" | "BuiltInLang" | "BuiltInLangmatches" | "BuiltInDatatype" | "BuiltInBound" | "BuiltInIri" | "BuiltInUri" | "BuiltInBnode" | "BuiltInRand" | "BuiltInAbs" | "BuiltInCeil" | "BuiltInFloor" | "BuiltInRound" | "BuiltInConcat" | "BuiltInStrlen" | "BuiltInUcase" | "BuiltInLcase" | "BuiltInEncode_for_uri" | "BuiltInContains" | "BuiltInStrstarts" | "BuiltInStrends" | "BuiltInStrbefore" | "BuiltInStrafter" | "BuiltInYear" | "BuiltInMonth" | "BuiltInDay" | "BuiltInHours" | "BuiltInMinutes" | "BuiltInSeconds" | "BuiltInTimezone" | "BuiltInTz" | "BuiltInNow" | "BuiltInUuid" | "BuiltInStruuid" | "BuiltInMd5" | "BuiltInSha1" | "BuiltInSha256" | "BuiltInSha384" | "BuiltInSha512" | "BuiltInCoalesce" | "BuiltInIf" | "BuiltInStrlang" | "BuiltInStrdt" | "BuiltInSameterm" | "BuiltInIsiri" | "BuiltInIsuri" | "BuiltInIsblank" | "BuiltInIsliteral" | "BuiltInIsnumeric" | "BuiltInRegex" | "BuiltInSubstr" | "BuiltInReplace" | "BuiltInExists" | "BuiltInNotexists" | "BuiltInCount" | "BuiltInSum" | "BuiltInMin" | "BuiltInMax" | "BuiltInAvg" | "BuiltInSample" | "BuiltInGroup_concat" | "NamedGraph" | "DefaultGraph" | "Graph" | "GraphAll" | "LCurly" | "RCurly" | "Dot" | "Comma" | "Semi" | "LParen" | "RParen" | "LSquare" | "RSquare" | "Pipe" | "Slash" | "Hat" | "Question" | "Star" | "OpPlus" | "OpMinus" | "Exclamation" | "LogicAnd" | "LogicOr" | "Equal" | "NotEqual" | "LessThan" | "GreaterThan" | "LessThanEqual" | "GreaterThanEqual" | "Hathat" | "IriRef" | "PNameLn" | "PNameNs" | "BlankNodeLabel" | "Var1" | "Var2" | "Integer" | "Decimal" | "Double" | "InterferePositive" | "DecimalPositive" | "DoublePositive" | "IntegerNegative" | "DecimalNegative" | "DoubleNegative" | "StringLiteral1" | "StringLiteral2" | "StringLiteralLong1" | "StringLiteralLong2" | "Ws" | "Comment" | "Nil" | "Anon" | "BaseDecl" | "PrefixDecl" | "Select" | "Distinct" | "Reduced" | "As" | "Construct" | "Describe" | "Ask" | "From" | "Where" | "GroupByGroup" | "By" | "Having" | "Order" | "OrderAsc" | "OrderDesc" | "Limit" | "Offset" | "Values" | "Load" | "Silent" | "LoadInto" | "Clear" | "Drop" | "Create" | "Add" | "To" | "Move" | "Copy" | "ModifyWith" | "DeleteClause" | "InsertClause" | "DataClause" | "UsingClause" | "Optional" | "Service" | "Bind" | "Undef" | "Minus" | "Union" | "Filter" | "True" | "False" | "In" | "NotIn" | "Separator" | "Version" | "Tilde" | "AnnotationOpen" | "AnnotationClose" | "ReificationOpen" | "ReificationClose" | "TripleTermOpen" | "TripleTermClose" | "BuiltInLangdir" | "BuiltInStrLangdir" | "BuiltInHasLang" | "BuiltInHasLangdir" | "BuiltInIsTriple" | "BuiltInTriple" | "BuiltInSubject" | "BuiltInPredicate" | "BuiltInObject" | "LANG_DIR">;
|
package/lib/lexer.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable require-unicode-regexp */
|
|
2
2
|
import { LexerBuilder, createToken } from '@traqula/core';
|
|
3
3
|
import { lex as l11 } from '@traqula/rules-sparql-1-1';
|
|
4
|
+
export const version = createToken({ name: 'Version', pattern: /version/i, label: 'version identifier' });
|
|
4
5
|
export const tilde = createToken({ name: 'Tilde', pattern: '~', label: '~' });
|
|
5
6
|
export const annotationOpen = createToken({ name: 'AnnotationOpen', pattern: '{|', label: `Annotation Open: {|` });
|
|
6
7
|
export const annotationClose = createToken({ name: 'AnnotationClose', pattern: '|}', label: 'Annotation Close |}' });
|
|
@@ -32,7 +33,7 @@ export const LANG_DIR = createToken({
|
|
|
32
33
|
});
|
|
33
34
|
export const sparql12Tokens = LexerBuilder
|
|
34
35
|
.create(l11.sparql11Tokens)
|
|
35
|
-
.addBefore(l11.symbols.logicAnd, tilde, annotationOpen, annotationClose, tripleTermOpen, tripleTermClose, reificationOpen, reificationClose)
|
|
36
|
+
.addBefore(l11.symbols.logicAnd, tilde, annotationOpen, annotationClose, tripleTermOpen, tripleTermClose, reificationOpen, reificationClose, version)
|
|
36
37
|
.addBefore(l11.builtIn.langmatches, builtinLangDir, builtinStrLangDir, builtinHasLangDir, builtinHasLang, builtinIsTRIPLE, builtinTRIPLE, builtinSUBJECT, builtinPREDICATE, builtinOBJECT)
|
|
37
38
|
.addBefore(l11.terminals.langTag, LANG_DIR)
|
|
38
39
|
.delete(l11.terminals.langTag);
|
package/lib/lexer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexer.js","sourceRoot":"","sources":["lexer.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,GAAG,IAAI,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAEvD,MAAM,CAAC,MAAM,KAAK,GAAG,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC,CAAC;AACnH,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC,CAAC;AACrH,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC,CAAC;AACrH,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,sBAAsB,E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,OAAO,CACR;KACA,SAAS,CACR,GAAG,CAAC,OAAO,CAAC,WAAW,EACvB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,aAAa,CACd;KACA,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC;KAC1C,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC","sourcesContent":["/* eslint-disable require-unicode-regexp */\nimport { LexerBuilder, createToken } from '@traqula/core';\nimport { lex as l11 } from '@traqula/rules-sparql-1-1';\n\nexport const version = createToken({ name: 'Version', pattern: /version/i, label: 'version identifier' });\nexport const tilde = createToken({ name: 'Tilde', pattern: '~', label: '~' });\nexport const annotationOpen = createToken({ name: 'AnnotationOpen', pattern: '{|', label: `Annotation Open: {|` });\nexport const annotationClose = createToken({ name: 'AnnotationClose', pattern: '|}', label: 'Annotation Close |}' });\nexport const reificationOpen = createToken({ name: 'ReificationOpen', pattern: '<<', label: 'Reification open <<' });\nexport const reificationClose = createToken({ name: 'ReificationClose', pattern: '>>', label: 'Reification close >>' });\nexport const tripleTermOpen = createToken({ name: 'TripleTermOpen', pattern: '<<(', label: 'Triple Term Open <<(' });\nexport const tripleTermClose = createToken({ name: 'TripleTermClose', pattern: ')>>', label: 'Triple Term Close )>>' });\n\nexport const builtinLangDir = createToken({ name: 'BuiltInLangdir', pattern: /langdir/i, label: 'LANGDIR' });\nexport const builtinStrLangDir = createToken({\n name: 'BuiltInStrLangdir',\n pattern: /strlangdir/i,\n label: 'STRLANGDIR',\n});\nexport const builtinHasLang = createToken({ name: 'BuiltInHasLang', pattern: /haslang/i, label: 'hasLANG' });\nexport const builtinHasLangDir = createToken({\n name: 'BuiltInHasLangdir',\n pattern: /haslangdir/i,\n label: 'hasLANGDIR',\n});\nexport const builtinIsTRIPLE = createToken({ name: 'BuiltInIsTriple', pattern: /istriple/i, label: 'isTRIPLE' });\nexport const builtinTRIPLE = createToken({ name: 'BuiltInTriple', pattern: /triple/i, label: 'TRIPLE' });\nexport const builtinSUBJECT = createToken({ name: 'BuiltInSubject', pattern: /subject/i, label: 'SUBJECT' });\nexport const builtinPREDICATE = createToken({ name: 'BuiltInPredicate', pattern: /predicate/i, label: 'PREDICATE' });\nexport const builtinOBJECT = createToken({ name: 'BuiltInObject', pattern: /object/i, label: 'OBJECT' });\n\nexport const LANG_DIR = createToken({\n name: 'LANG_DIR',\n pattern: /@[a-z]+(?:-[\\da-z]+)*(?:--[a-z]+)?/i,\n label: 'LANG_DIR',\n});\n\nexport const sparql12Tokens = LexerBuilder\n .create(l11.sparql11Tokens)\n .addBefore(\n l11.symbols.logicAnd,\n tilde,\n annotationOpen,\n annotationClose,\n tripleTermOpen,\n tripleTermClose,\n reificationOpen,\n reificationClose,\n version,\n )\n .addBefore(\n l11.builtIn.langmatches,\n builtinLangDir,\n builtinStrLangDir,\n builtinHasLangDir,\n builtinHasLang,\n builtinIsTRIPLE,\n builtinTRIPLE,\n builtinSUBJECT,\n builtinPREDICATE,\n builtinOBJECT,\n )\n .addBefore(l11.terminals.langTag, LANG_DIR)\n .delete(l11.terminals.langTag);\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Factory } from './Factory';
|
|
2
|
+
export function completeParseContext(context) {
|
|
3
|
+
return {
|
|
4
|
+
factory: context.factory ?? new Factory(),
|
|
5
|
+
baseIRI: context.baseIRI,
|
|
6
|
+
prefixes: { ...context.prefixes },
|
|
7
|
+
origSource: context.origSource ?? '',
|
|
8
|
+
offset: context.offset,
|
|
9
|
+
parseMode: context.parseMode ? new Set(context.parseMode) : new Set(['canParseVars', 'canCreateBlankNodes']),
|
|
10
|
+
skipValidation: context.skipValidation ?? false,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=parserUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parserUtils.js","sourceRoot":"","sources":["parserUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,UAAU,oBAAoB,CAClC,OAAyE;IAEzE,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,IAAI,OAAO,EAAE;QACzC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,QAAQ,EAAE,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE;QACjC,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE;QACpC,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAE,cAAc,EAAE,qBAAqB,CAAE,CAAC;QAC9G,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,KAAK;KAChD,CAAC;AACJ,CAAC","sourcesContent":["import { Factory } from './Factory';\nimport type { SparqlContext } from './sparql12HelperTypes';\n\nexport function completeParseContext(\n context: Partial<SparqlContext & { origSource: string; offset?: number }>,\n): SparqlContext & { origSource: string; offset?: number } {\n return {\n factory: context.factory ?? new Factory(),\n baseIRI: context.baseIRI,\n prefixes: { ...context.prefixes },\n origSource: context.origSource ?? '',\n offset: context.offset,\n parseMode: context.parseMode ? new Set(context.parseMode) : new Set([ 'canParseVars', 'canCreateBlankNodes' ]),\n skipValidation: context.skipValidation ?? false,\n };\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { GeneratorRule, ParserRule } from '@traqula/core';
|
|
2
|
+
import type * as T11 from '@traqula/rules-sparql-1-1';
|
|
3
|
+
import type { Factory } from './Factory';
|
|
4
|
+
export type SparqlRule<
|
|
5
|
+
/**
|
|
6
|
+
* Name of grammar rule, should be a strict subtype of string like 'myGrammarRule'.
|
|
7
|
+
*/
|
|
8
|
+
NameType extends string = string,
|
|
9
|
+
/**
|
|
10
|
+
* Type that will be returned after a correct parse of this rule.
|
|
11
|
+
* This type will be the return type of calling SUBRULE with this grammar rule.
|
|
12
|
+
*/
|
|
13
|
+
ReturnType = unknown, GenInputType = ReturnType,
|
|
14
|
+
/**
|
|
15
|
+
* Function arguments that can be given to convey the state of the current parse operation.
|
|
16
|
+
*/
|
|
17
|
+
ParamType = undefined> = SparqlGrammarRule<NameType, ReturnType, ParamType> & SparqlGeneratorRule<NameType, GenInputType, ParamType>;
|
|
18
|
+
export type SparqlGeneratorRule<
|
|
19
|
+
/**
|
|
20
|
+
* Name of grammar rule, should be a strict subtype of string like 'myGrammarRule'.
|
|
21
|
+
*/
|
|
22
|
+
NameType extends string = string,
|
|
23
|
+
/**
|
|
24
|
+
* Type that will be returned after a correct parse of this rule.
|
|
25
|
+
* This type will be the return type of calling SUBRULE with this grammar rule.
|
|
26
|
+
*/
|
|
27
|
+
ReturnType = unknown,
|
|
28
|
+
/**
|
|
29
|
+
* Function arguments that can be given to convey the state of the current parse operation.
|
|
30
|
+
*/
|
|
31
|
+
ParamType = undefined> = GeneratorRule<{
|
|
32
|
+
factory: Factory;
|
|
33
|
+
}, NameType, ReturnType, ParamType>;
|
|
34
|
+
export type SparqlGrammarRule<
|
|
35
|
+
/**
|
|
36
|
+
* Name of grammar rule, should be a strict subtype of string like 'myGrammarRule'.
|
|
37
|
+
*/
|
|
38
|
+
NameType extends string = string,
|
|
39
|
+
/**
|
|
40
|
+
* Type that will be returned after a correct parse of this rule.
|
|
41
|
+
* This type will be the return type of calling SUBRULE with this grammar rule.
|
|
42
|
+
*/
|
|
43
|
+
ReturnType = unknown,
|
|
44
|
+
/**
|
|
45
|
+
* Function arguments that can be given to convey the state of the current parse operation.
|
|
46
|
+
*/
|
|
47
|
+
ParamType = undefined> = ParserRule<SparqlContext, NameType, ReturnType, ParamType>;
|
|
48
|
+
export type SparqlContext = T11.SparqlContext & {
|
|
49
|
+
factory: Factory;
|
|
50
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sparql12HelperTypes.js","sourceRoot":"","sources":["sparql12HelperTypes.ts"],"names":[],"mappings":"","sourcesContent":["import type { GeneratorRule, ParserRule } from '@traqula/core';\nimport type * as T11 from '@traqula/rules-sparql-1-1';\nimport type { Factory } from './Factory';\n\nexport type SparqlRule<\n /**\n * Name of grammar rule, should be a strict subtype of string like 'myGrammarRule'.\n */\n NameType extends string = string,\n /**\n * Type that will be returned after a correct parse of this rule.\n * This type will be the return type of calling SUBRULE with this grammar rule.\n */\n ReturnType = unknown,\n GenInputType = ReturnType,\n /**\n * Function arguments that can be given to convey the state of the current parse operation.\n */\n ParamType = undefined,\n> = SparqlGrammarRule<NameType, ReturnType, ParamType>\n & SparqlGeneratorRule<NameType, GenInputType, ParamType>;\n\nexport type SparqlGeneratorRule<\n /**\n * Name of grammar rule, should be a strict subtype of string like 'myGrammarRule'.\n */\n NameType extends string = string,\n /**\n * Type that will be returned after a correct parse of this rule.\n * This type will be the return type of calling SUBRULE with this grammar rule.\n */\n ReturnType = unknown,\n /**\n * Function arguments that can be given to convey the state of the current parse operation.\n */\n ParamType = undefined,\n> = GeneratorRule<{ factory: Factory }, NameType, ReturnType, ParamType>;\n\nexport type SparqlGrammarRule<\n /**\n * Name of grammar rule, should be a strict subtype of string like 'myGrammarRule'.\n */\n NameType extends string = string,\n /**\n * Type that will be returned after a correct parse of this rule.\n * This type will be the return type of calling SUBRULE with this grammar rule.\n */\n ReturnType = unknown,\n /**\n * Function arguments that can be given to convey the state of the current parse operation.\n */\n ParamType = undefined,\n> = ParserRule<SparqlContext, NameType, ReturnType, ParamType>;\n\nexport type SparqlContext = T11.SparqlContext & { factory: Factory };\n"]}
|