cspell-grammar 6.14.2 → 6.14.3
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/dist/parser/grammar.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GrammarDef } from './grammarDefinition';
|
|
2
2
|
import { NGrammar } from './grammarNormalized';
|
|
3
|
-
export
|
|
3
|
+
export type Grammar = NGrammar;
|
|
4
4
|
export declare function compileGrammar(grammar: GrammarDef): Grammar;
|
|
5
5
|
//# sourceMappingURL=grammar.d.ts.map
|
|
@@ -5,15 +5,15 @@ export interface GrammarDef extends PatternPatterns {
|
|
|
5
5
|
/**
|
|
6
6
|
* @pattern ^[-\w.]+$
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type ScopeName = string;
|
|
9
9
|
/**
|
|
10
10
|
* @pattern ^source\.[-\w.]+$
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
export
|
|
16
|
-
export
|
|
12
|
+
export type ScopeSource = string;
|
|
13
|
+
export type Pattern = _Pattern;
|
|
14
|
+
type _Pattern = PatternMatch | PatternBeginEnd | PatternInclude | PatternPatterns | PatternName;
|
|
15
|
+
export type PatternList = (Pattern | PatternRef)[];
|
|
16
|
+
export type Match = string | RegExp;
|
|
17
17
|
/**
|
|
18
18
|
* A Pattern with a name but no match clauses.
|
|
19
19
|
* Used in Capture
|
|
@@ -91,15 +91,15 @@ export interface PatternInclude extends PatternBase {
|
|
|
91
91
|
* Reference to a Repository pattern
|
|
92
92
|
* @pattern ^(#.*|$self|$base)$
|
|
93
93
|
*/
|
|
94
|
-
export
|
|
94
|
+
export type RepositoryReference = string;
|
|
95
95
|
/**
|
|
96
96
|
* Reference to an external grammar.
|
|
97
97
|
* @pattern ^source\..*$
|
|
98
98
|
*/
|
|
99
|
-
export
|
|
100
|
-
export
|
|
101
|
-
export
|
|
102
|
-
export
|
|
99
|
+
export type ExternalGrammarReference = string;
|
|
100
|
+
export type PatternRef = RepositoryReference | ExternalGrammarReference;
|
|
101
|
+
export type Repository = Record<string, Pattern>;
|
|
102
|
+
export type Captures = ScopeName | Record<string | number, PatternName | ScopeName>;
|
|
103
103
|
export interface PatternBase {
|
|
104
104
|
/** Optional name scope */
|
|
105
105
|
name?: ScopeName | undefined;
|
|
@@ -15,13 +15,13 @@ export interface NGrammar {
|
|
|
15
15
|
/**
|
|
16
16
|
* @pattern ^[-\w.]+$
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export type NScope = string;
|
|
19
19
|
/**
|
|
20
20
|
* @pattern ^source\.[-\w.]+$
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
22
|
+
export type NScopeSource = string;
|
|
23
|
+
export type NPattern = NPatternBeginEnd | NPatternInclude | NPatternMatch | NPatternName | NPatternPatterns | NPatternRepositoryReference;
|
|
24
|
+
export type Match = string | RegExp;
|
|
25
25
|
/**
|
|
26
26
|
* A Pattern with a name but no match clauses.
|
|
27
27
|
* Used with Capture
|
|
@@ -74,15 +74,15 @@ export interface NPatternInclude extends NPatternBase {
|
|
|
74
74
|
* Reference to a Repository pattern
|
|
75
75
|
* @pattern ^([\w-]+|$self|$base)$
|
|
76
76
|
*/
|
|
77
|
-
export
|
|
77
|
+
export type NRepositoryReference = string;
|
|
78
78
|
/**
|
|
79
79
|
* Reference to an external grammar.
|
|
80
80
|
* @pattern ^source\..*$
|
|
81
81
|
*/
|
|
82
|
-
export
|
|
83
|
-
export
|
|
84
|
-
export
|
|
85
|
-
export
|
|
82
|
+
export type ExternalGrammarReference = string;
|
|
83
|
+
export type IncludeExternalRef = ExternalGrammarReference;
|
|
84
|
+
export type NRepository = Record<string, NPattern>;
|
|
85
|
+
export type NCaptures = Record<string | number, NScope>;
|
|
86
86
|
export interface Rule {
|
|
87
87
|
id: number;
|
|
88
88
|
grammar: NGrammar;
|
package/dist/parser/types.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export interface LineOffsetAnchored extends LineOffset {
|
|
|
31
31
|
/** The anchor is the position at the end of the last match */
|
|
32
32
|
anchor: number;
|
|
33
33
|
}
|
|
34
|
-
export
|
|
34
|
+
export type Groups = Record<string, string | undefined>;
|
|
35
35
|
export interface MatchResult {
|
|
36
36
|
/** offset of the match into the input strings */
|
|
37
37
|
index: number;
|
|
@@ -60,7 +60,7 @@ export interface MatchSegment {
|
|
|
60
60
|
groupNum: number;
|
|
61
61
|
groupName: string | string[] | undefined;
|
|
62
62
|
}
|
|
63
|
-
export
|
|
63
|
+
export type AppliedScopes = Scope[];
|
|
64
64
|
export interface TokenizedLine {
|
|
65
65
|
tokens: TokenizedText[];
|
|
66
66
|
line: Line;
|
|
@@ -86,10 +86,10 @@ export interface TokenizedText {
|
|
|
86
86
|
/**
|
|
87
87
|
* A Range that is relative to the beginning of a line.
|
|
88
88
|
*/
|
|
89
|
-
export
|
|
89
|
+
export type RangeRelativeToLine = [start: number, end: number, line: number];
|
|
90
90
|
/**
|
|
91
91
|
* A Range where the start and end are relative to the beginning of the document.
|
|
92
92
|
*/
|
|
93
|
-
export
|
|
94
|
-
export
|
|
93
|
+
export type RangeAbsolute = [start: number, end: number];
|
|
94
|
+
export type Range = RangeAbsolute | RangeRelativeToLine;
|
|
95
95
|
//# sourceMappingURL=types.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cspell-grammar",
|
|
3
|
-
"version": "6.14.
|
|
3
|
+
"version": "6.14.3",
|
|
4
4
|
"description": "Grammar parsing support for cspell",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cspell",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"rimraf": "^3.0.2"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@cspell/cspell-pipe": "6.14.
|
|
73
|
-
"@cspell/cspell-types": "6.14.
|
|
72
|
+
"@cspell/cspell-pipe": "6.14.3",
|
|
73
|
+
"@cspell/cspell-types": "6.14.3"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "df0efdbb0dc7b084579130ba5fe97441c0ab67ca"
|
|
76
76
|
}
|