feelin 4.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.
- checksums.yaml +7 -0
- data/.gitignore +6 -0
- data/.rspec +2 -0
- data/CHANGELOG.md +10 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/feelin.gemspec +22 -0
- data/lib/feelin/js/node_modules/.package-lock.json +67 -0
- data/lib/feelin/js/node_modules/@lezer/common/LICENSE +21 -0
- data/lib/feelin/js/node_modules/@lezer/common/README.md +14 -0
- data/lib/feelin/js/node_modules/@lezer/common/dist/index.cjs +2181 -0
- data/lib/feelin/js/node_modules/@lezer/common/dist/index.d.cts +1137 -0
- data/lib/feelin/js/node_modules/@lezer/common/dist/index.d.ts +1137 -0
- data/lib/feelin/js/node_modules/@lezer/common/dist/index.js +2168 -0
- data/lib/feelin/js/node_modules/@lezer/common/package.json +32 -0
- data/lib/feelin/js/node_modules/@lezer/highlight/LICENSE +21 -0
- data/lib/feelin/js/node_modules/@lezer/highlight/README.md +14 -0
- data/lib/feelin/js/node_modules/@lezer/highlight/dist/index.cjs +915 -0
- data/lib/feelin/js/node_modules/@lezer/highlight/dist/index.d.cts +621 -0
- data/lib/feelin/js/node_modules/@lezer/highlight/dist/index.d.ts +623 -0
- data/lib/feelin/js/node_modules/@lezer/highlight/dist/index.js +904 -0
- data/lib/feelin/js/node_modules/@lezer/highlight/package.json +31 -0
- data/lib/feelin/js/node_modules/@lezer/lr/LICENSE +21 -0
- data/lib/feelin/js/node_modules/@lezer/lr/README.md +25 -0
- data/lib/feelin/js/node_modules/@lezer/lr/dist/constants.d.ts +45 -0
- data/lib/feelin/js/node_modules/@lezer/lr/dist/constants.js +5 -0
- data/lib/feelin/js/node_modules/@lezer/lr/dist/index.cjs +1890 -0
- data/lib/feelin/js/node_modules/@lezer/lr/dist/index.d.cts +303 -0
- data/lib/feelin/js/node_modules/@lezer/lr/dist/index.d.ts +303 -0
- data/lib/feelin/js/node_modules/@lezer/lr/dist/index.js +1883 -0
- data/lib/feelin/js/node_modules/@lezer/lr/package.json +32 -0
- data/lib/feelin/js/node_modules/feelin/LICENSE +21 -0
- data/lib/feelin/js/node_modules/feelin/README.md +65 -0
- data/lib/feelin/js/node_modules/feelin/dist/builtins.d.ts +355 -0
- data/lib/feelin/js/node_modules/feelin/dist/index.cjs +2072 -0
- data/lib/feelin/js/node_modules/feelin/dist/index.cjs.map +1 -0
- data/lib/feelin/js/node_modules/feelin/dist/index.d.ts +3 -0
- data/lib/feelin/js/node_modules/feelin/dist/index.esm.js +2063 -0
- data/lib/feelin/js/node_modules/feelin/dist/index.esm.js.map +1 -0
- data/lib/feelin/js/node_modules/feelin/dist/interpreter.d.ts +26 -0
- data/lib/feelin/js/node_modules/feelin/dist/parser.d.ts +4 -0
- data/lib/feelin/js/node_modules/feelin/dist/temporal.d.ts +6 -0
- data/lib/feelin/js/node_modules/feelin/dist/types.d.ts +35 -0
- data/lib/feelin/js/node_modules/feelin/dist/utils.d.ts +12 -0
- data/lib/feelin/js/node_modules/feelin/package.json +63 -0
- data/lib/feelin/js/node_modules/lezer-feel/LICENSE +21 -0
- data/lib/feelin/js/node_modules/lezer-feel/README.md +94 -0
- data/lib/feelin/js/node_modules/lezer-feel/dist/index.cjs +1328 -0
- data/lib/feelin/js/node_modules/lezer-feel/dist/index.cjs.map +1 -0
- data/lib/feelin/js/node_modules/lezer-feel/dist/index.d.ts +32 -0
- data/lib/feelin/js/node_modules/lezer-feel/dist/index.js +1323 -0
- data/lib/feelin/js/node_modules/lezer-feel/dist/index.js.map +1 -0
- data/lib/feelin/js/node_modules/lezer-feel/package.json +61 -0
- data/lib/feelin/js/node_modules/luxon/LICENSE.md +7 -0
- data/lib/feelin/js/node_modules/luxon/README.md +55 -0
- data/lib/feelin/js/node_modules/luxon/build/amd/luxon.js +8623 -0
- data/lib/feelin/js/node_modules/luxon/build/amd/luxon.js.map +1 -0
- data/lib/feelin/js/node_modules/luxon/build/cjs-browser/luxon.js +8621 -0
- data/lib/feelin/js/node_modules/luxon/build/cjs-browser/luxon.js.map +1 -0
- data/lib/feelin/js/node_modules/luxon/build/es6/luxon.js +8011 -0
- data/lib/feelin/js/node_modules/luxon/build/es6/luxon.js.map +1 -0
- data/lib/feelin/js/node_modules/luxon/build/global/luxon.js +8626 -0
- data/lib/feelin/js/node_modules/luxon/build/global/luxon.js.map +1 -0
- data/lib/feelin/js/node_modules/luxon/build/global/luxon.min.js +1 -0
- data/lib/feelin/js/node_modules/luxon/build/global/luxon.min.js.map +1 -0
- data/lib/feelin/js/node_modules/luxon/build/node/luxon.js +7679 -0
- data/lib/feelin/js/node_modules/luxon/build/node/luxon.js.map +1 -0
- data/lib/feelin/js/node_modules/luxon/package.json +87 -0
- data/lib/feelin/js/node_modules/luxon/src/datetime.js +2566 -0
- data/lib/feelin/js/node_modules/luxon/src/duration.js +990 -0
- data/lib/feelin/js/node_modules/luxon/src/errors.js +61 -0
- data/lib/feelin/js/node_modules/luxon/src/impl/conversions.js +206 -0
- data/lib/feelin/js/node_modules/luxon/src/impl/diff.js +95 -0
- data/lib/feelin/js/node_modules/luxon/src/impl/digits.js +90 -0
- data/lib/feelin/js/node_modules/luxon/src/impl/english.js +233 -0
- data/lib/feelin/js/node_modules/luxon/src/impl/formats.js +176 -0
- data/lib/feelin/js/node_modules/luxon/src/impl/formatter.js +409 -0
- data/lib/feelin/js/node_modules/luxon/src/impl/invalid.js +14 -0
- data/lib/feelin/js/node_modules/luxon/src/impl/locale.js +554 -0
- data/lib/feelin/js/node_modules/luxon/src/impl/regexParser.js +335 -0
- data/lib/feelin/js/node_modules/luxon/src/impl/tokenParser.js +505 -0
- data/lib/feelin/js/node_modules/luxon/src/impl/util.js +316 -0
- data/lib/feelin/js/node_modules/luxon/src/impl/zoneUtil.js +34 -0
- data/lib/feelin/js/node_modules/luxon/src/info.js +205 -0
- data/lib/feelin/js/node_modules/luxon/src/interval.js +665 -0
- data/lib/feelin/js/node_modules/luxon/src/luxon.js +26 -0
- data/lib/feelin/js/node_modules/luxon/src/package.json +4 -0
- data/lib/feelin/js/node_modules/luxon/src/settings.js +180 -0
- data/lib/feelin/js/node_modules/luxon/src/zone.js +97 -0
- data/lib/feelin/js/node_modules/luxon/src/zones/IANAZone.js +231 -0
- data/lib/feelin/js/node_modules/luxon/src/zones/fixedOffsetZone.js +150 -0
- data/lib/feelin/js/node_modules/luxon/src/zones/invalidZone.js +53 -0
- data/lib/feelin/js/node_modules/luxon/src/zones/systemZone.js +61 -0
- data/lib/feelin/js/node_modules/min-dash/LICENSE +21 -0
- data/lib/feelin/js/node_modules/min-dash/README.md +38 -0
- data/lib/feelin/js/node_modules/min-dash/dist/array.d.ts +12 -0
- data/lib/feelin/js/node_modules/min-dash/dist/collection.d.ts +174 -0
- data/lib/feelin/js/node_modules/min-dash/dist/fn.d.ts +37 -0
- data/lib/feelin/js/node_modules/min-dash/dist/index.cjs +910 -0
- data/lib/feelin/js/node_modules/min-dash/dist/index.d.ts +5 -0
- data/lib/feelin/js/node_modules/min-dash/dist/index.esm.js +872 -0
- data/lib/feelin/js/node_modules/min-dash/dist/lang.d.ts +29 -0
- data/lib/feelin/js/node_modules/min-dash/dist/min-dash.js +916 -0
- data/lib/feelin/js/node_modules/min-dash/dist/min-dash.min.js +1 -0
- data/lib/feelin/js/node_modules/min-dash/dist/object.d.ts +112 -0
- data/lib/feelin/js/node_modules/min-dash/package.json +72 -0
- data/lib/feelin/js/package-lock.json +72 -0
- data/lib/feelin/js/package.json +5 -0
- data/lib/feelin/version.rb +3 -0
- data/lib/feelin.rb +63 -0
- data/spec/feelin/feelin_spec.rb +38 -0
- data/spec/spec_helper.rb +2 -0
- metadata +198 -0
@@ -0,0 +1,621 @@
|
|
1
|
+
import * as _lezer_common from '@lezer/common';
|
2
|
+
import { NodeType, Tree, SyntaxNodeRef } from '@lezer/common';
|
3
|
+
|
4
|
+
/**
|
5
|
+
Highlighting tags are markers that denote a highlighting category.
|
6
|
+
They are [associated](#highlight.styleTags) with parts of a syntax
|
7
|
+
tree by a language mode, and then mapped to an actual CSS style by
|
8
|
+
a [highlighter](#highlight.Highlighter).
|
9
|
+
|
10
|
+
Because syntax tree node types and highlight styles have to be
|
11
|
+
able to talk the same language, CodeMirror uses a mostly _closed_
|
12
|
+
[vocabulary](#highlight.tags) of syntax tags (as opposed to
|
13
|
+
traditional open string-based systems, which make it hard for
|
14
|
+
highlighting themes to cover all the tokens produced by the
|
15
|
+
various languages).
|
16
|
+
|
17
|
+
It _is_ possible to [define](#highlight.Tag^define) your own
|
18
|
+
highlighting tags for system-internal use (where you control both
|
19
|
+
the language package and the highlighter), but such tags will not
|
20
|
+
be picked up by regular highlighters (though you can derive them
|
21
|
+
from standard tags to allow highlighters to fall back to those).
|
22
|
+
*/
|
23
|
+
declare class Tag {
|
24
|
+
/**
|
25
|
+
The set of this tag and all its parent tags, starting with
|
26
|
+
this one itself and sorted in order of decreasing specificity.
|
27
|
+
*/
|
28
|
+
readonly set: Tag[];
|
29
|
+
/**
|
30
|
+
Define a new tag. If `parent` is given, the tag is treated as a
|
31
|
+
sub-tag of that parent, and
|
32
|
+
[highlighters](#highlight.tagHighlighter) that don't mention
|
33
|
+
this tag will try to fall back to the parent tag (or grandparent
|
34
|
+
tag, etc).
|
35
|
+
*/
|
36
|
+
static define(parent?: Tag): Tag;
|
37
|
+
/**
|
38
|
+
Define a tag _modifier_, which is a function that, given a tag,
|
39
|
+
will return a tag that is a subtag of the original. Applying the
|
40
|
+
same modifier to a twice tag will return the same value (`m1(t1)
|
41
|
+
== m1(t1)`) and applying multiple modifiers will, regardless or
|
42
|
+
order, produce the same tag (`m1(m2(t1)) == m2(m1(t1))`).
|
43
|
+
|
44
|
+
When multiple modifiers are applied to a given base tag, each
|
45
|
+
smaller set of modifiers is registered as a parent, so that for
|
46
|
+
example `m1(m2(m3(t1)))` is a subtype of `m1(m2(t1))`,
|
47
|
+
`m1(m3(t1)`, and so on.
|
48
|
+
*/
|
49
|
+
static defineModifier(): (tag: Tag) => Tag;
|
50
|
+
}
|
51
|
+
/**
|
52
|
+
This function is used to add a set of tags to a language syntax
|
53
|
+
via [`NodeSet.extend`](#common.NodeSet.extend) or
|
54
|
+
[`LRParser.configure`](#lr.LRParser.configure).
|
55
|
+
|
56
|
+
The argument object maps node selectors to [highlighting
|
57
|
+
tags](#highlight.Tag) or arrays of tags.
|
58
|
+
|
59
|
+
Node selectors may hold one or more (space-separated) node paths.
|
60
|
+
Such a path can be a [node name](#common.NodeType.name), or
|
61
|
+
multiple node names (or `*` wildcards) separated by slash
|
62
|
+
characters, as in `"Block/Declaration/VariableName"`. Such a path
|
63
|
+
matches the final node but only if its direct parent nodes are the
|
64
|
+
other nodes mentioned. A `*` in such a path matches any parent,
|
65
|
+
but only a single level—wildcards that match multiple parents
|
66
|
+
aren't supported, both for efficiency reasons and because Lezer
|
67
|
+
trees make it rather hard to reason about what they would match.)
|
68
|
+
|
69
|
+
A path can be ended with `/...` to indicate that the tag assigned
|
70
|
+
to the node should also apply to all child nodes, even if they
|
71
|
+
match their own style (by default, only the innermost style is
|
72
|
+
used).
|
73
|
+
|
74
|
+
When a path ends in `!`, as in `Attribute!`, no further matching
|
75
|
+
happens for the node's child nodes, and the entire node gets the
|
76
|
+
given style.
|
77
|
+
|
78
|
+
In this notation, node names that contain `/`, `!`, `*`, or `...`
|
79
|
+
must be quoted as JSON strings.
|
80
|
+
|
81
|
+
For example:
|
82
|
+
|
83
|
+
```javascript
|
84
|
+
parser.withProps(
|
85
|
+
styleTags({
|
86
|
+
// Style Number and BigNumber nodes
|
87
|
+
"Number BigNumber": tags.number,
|
88
|
+
// Style Escape nodes whose parent is String
|
89
|
+
"String/Escape": tags.escape,
|
90
|
+
// Style anything inside Attributes nodes
|
91
|
+
"Attributes!": tags.meta,
|
92
|
+
// Add a style to all content inside Italic nodes
|
93
|
+
"Italic/...": tags.emphasis,
|
94
|
+
// Style InvalidString nodes as both `string` and `invalid`
|
95
|
+
"InvalidString": [tags.string, tags.invalid],
|
96
|
+
// Style the node named "/" as punctuation
|
97
|
+
'"/"': tags.punctuation
|
98
|
+
})
|
99
|
+
)
|
100
|
+
```
|
101
|
+
*/
|
102
|
+
declare function styleTags(spec: {
|
103
|
+
[selector: string]: Tag | readonly Tag[];
|
104
|
+
}): _lezer_common.NodePropSource;
|
105
|
+
/**
|
106
|
+
A highlighter defines a mapping from highlighting tags and
|
107
|
+
language scopes to CSS class names. They are usually defined via
|
108
|
+
[`tagHighlighter`](#highlight.tagHighlighter) or some wrapper
|
109
|
+
around that, but it is also possible to implement them from
|
110
|
+
scratch.
|
111
|
+
*/
|
112
|
+
interface Highlighter {
|
113
|
+
/**
|
114
|
+
Get the set of classes that should be applied to the given set
|
115
|
+
of highlighting tags, or null if this highlighter doesn't assign
|
116
|
+
a style to the tags.
|
117
|
+
*/
|
118
|
+
style(tags: readonly Tag[]): string | null;
|
119
|
+
/**
|
120
|
+
When given, the highlighter will only be applied to trees on
|
121
|
+
whose [top](#common.NodeType.isTop) node this predicate returns
|
122
|
+
true.
|
123
|
+
*/
|
124
|
+
scope?(node: NodeType): boolean;
|
125
|
+
}
|
126
|
+
/**
|
127
|
+
Define a [highlighter](#highlight.Highlighter) from an array of
|
128
|
+
tag/class pairs. Classes associated with more specific tags will
|
129
|
+
take precedence.
|
130
|
+
*/
|
131
|
+
declare function tagHighlighter(tags: readonly {
|
132
|
+
tag: Tag | readonly Tag[];
|
133
|
+
class: string;
|
134
|
+
}[], options?: {
|
135
|
+
/**
|
136
|
+
By default, highlighters apply to the entire document. You can
|
137
|
+
scope them to a single language by providing the tree's
|
138
|
+
[top](#common.NodeType.isTop) node type here.
|
139
|
+
*/
|
140
|
+
scope?: (node: NodeType) => boolean;
|
141
|
+
/**
|
142
|
+
Add a style to _all_ tokens. Probably only useful in combination
|
143
|
+
with `scope`.
|
144
|
+
*/
|
145
|
+
all?: string;
|
146
|
+
}): Highlighter;
|
147
|
+
/**
|
148
|
+
Highlight the given [tree](#common.Tree) with the given
|
149
|
+
[highlighter](#highlight.Highlighter). Often, the higher-level
|
150
|
+
[`highlightCode`](#highlight.highlightCode) function is easier to
|
151
|
+
use.
|
152
|
+
*/
|
153
|
+
declare function highlightTree(tree: Tree, highlighter: Highlighter | readonly Highlighter[],
|
154
|
+
/**
|
155
|
+
Assign styling to a region of the text. Will be called, in order
|
156
|
+
of position, for any ranges where more than zero classes apply.
|
157
|
+
`classes` is a space separated string of CSS classes.
|
158
|
+
*/
|
159
|
+
putStyle: (from: number, to: number, classes: string) => void,
|
160
|
+
/**
|
161
|
+
The start of the range to highlight.
|
162
|
+
*/
|
163
|
+
from?: number,
|
164
|
+
/**
|
165
|
+
The end of the range.
|
166
|
+
*/
|
167
|
+
to?: number): void;
|
168
|
+
/**
|
169
|
+
Highlight the given tree with the given highlighter, calling
|
170
|
+
`putText` for every piece of text, either with a set of classes or
|
171
|
+
with the empty string when unstyled, and `putBreak` for every line
|
172
|
+
break.
|
173
|
+
*/
|
174
|
+
declare function highlightCode(code: string, tree: Tree, highlighter: Highlighter | readonly Highlighter[], putText: (code: string, classes: string) => void, putBreak: () => void, from?: number, to?: number): void;
|
175
|
+
/**
|
176
|
+
Match a syntax node's [highlight rules](#highlight.styleTags). If
|
177
|
+
there's a match, return its set of tags, and whether it is
|
178
|
+
opaque (uses a `!`) or applies to all child nodes (`/...`).
|
179
|
+
*/
|
180
|
+
declare function getStyleTags(node: SyntaxNodeRef): {
|
181
|
+
tags: readonly Tag[];
|
182
|
+
opaque: boolean;
|
183
|
+
inherit: boolean;
|
184
|
+
} | null;
|
185
|
+
/**
|
186
|
+
The default set of highlighting [tags](#highlight.Tag).
|
187
|
+
|
188
|
+
This collection is heavily biased towards programming languages,
|
189
|
+
and necessarily incomplete. A full ontology of syntactic
|
190
|
+
constructs would fill a stack of books, and be impractical to
|
191
|
+
write themes for. So try to make do with this set. If all else
|
192
|
+
fails, [open an
|
193
|
+
issue](https://github.com/codemirror/codemirror.next) to propose a
|
194
|
+
new tag, or [define](#highlight.Tag^define) a local custom tag for
|
195
|
+
your use case.
|
196
|
+
|
197
|
+
Note that it is not obligatory to always attach the most specific
|
198
|
+
tag possible to an element—if your grammar can't easily
|
199
|
+
distinguish a certain type of element (such as a local variable),
|
200
|
+
it is okay to style it as its more general variant (a variable).
|
201
|
+
|
202
|
+
For tags that extend some parent tag, the documentation links to
|
203
|
+
the parent.
|
204
|
+
*/
|
205
|
+
declare const tags: {
|
206
|
+
/**
|
207
|
+
A comment.
|
208
|
+
*/
|
209
|
+
comment: Tag;
|
210
|
+
/**
|
211
|
+
A line [comment](#highlight.tags.comment).
|
212
|
+
*/
|
213
|
+
lineComment: Tag;
|
214
|
+
/**
|
215
|
+
A block [comment](#highlight.tags.comment).
|
216
|
+
*/
|
217
|
+
blockComment: Tag;
|
218
|
+
/**
|
219
|
+
A documentation [comment](#highlight.tags.comment).
|
220
|
+
*/
|
221
|
+
docComment: Tag;
|
222
|
+
/**
|
223
|
+
Any kind of identifier.
|
224
|
+
*/
|
225
|
+
name: Tag;
|
226
|
+
/**
|
227
|
+
The [name](#highlight.tags.name) of a variable.
|
228
|
+
*/
|
229
|
+
variableName: Tag;
|
230
|
+
/**
|
231
|
+
A type [name](#highlight.tags.name).
|
232
|
+
*/
|
233
|
+
typeName: Tag;
|
234
|
+
/**
|
235
|
+
A tag name (subtag of [`typeName`](#highlight.tags.typeName)).
|
236
|
+
*/
|
237
|
+
tagName: Tag;
|
238
|
+
/**
|
239
|
+
A property or field [name](#highlight.tags.name).
|
240
|
+
*/
|
241
|
+
propertyName: Tag;
|
242
|
+
/**
|
243
|
+
An attribute name (subtag of [`propertyName`](#highlight.tags.propertyName)).
|
244
|
+
*/
|
245
|
+
attributeName: Tag;
|
246
|
+
/**
|
247
|
+
The [name](#highlight.tags.name) of a class.
|
248
|
+
*/
|
249
|
+
className: Tag;
|
250
|
+
/**
|
251
|
+
A label [name](#highlight.tags.name).
|
252
|
+
*/
|
253
|
+
labelName: Tag;
|
254
|
+
/**
|
255
|
+
A namespace [name](#highlight.tags.name).
|
256
|
+
*/
|
257
|
+
namespace: Tag;
|
258
|
+
/**
|
259
|
+
The [name](#highlight.tags.name) of a macro.
|
260
|
+
*/
|
261
|
+
macroName: Tag;
|
262
|
+
/**
|
263
|
+
A literal value.
|
264
|
+
*/
|
265
|
+
literal: Tag;
|
266
|
+
/**
|
267
|
+
A string [literal](#highlight.tags.literal).
|
268
|
+
*/
|
269
|
+
string: Tag;
|
270
|
+
/**
|
271
|
+
A documentation [string](#highlight.tags.string).
|
272
|
+
*/
|
273
|
+
docString: Tag;
|
274
|
+
/**
|
275
|
+
A character literal (subtag of [string](#highlight.tags.string)).
|
276
|
+
*/
|
277
|
+
character: Tag;
|
278
|
+
/**
|
279
|
+
An attribute value (subtag of [string](#highlight.tags.string)).
|
280
|
+
*/
|
281
|
+
attributeValue: Tag;
|
282
|
+
/**
|
283
|
+
A number [literal](#highlight.tags.literal).
|
284
|
+
*/
|
285
|
+
number: Tag;
|
286
|
+
/**
|
287
|
+
An integer [number](#highlight.tags.number) literal.
|
288
|
+
*/
|
289
|
+
integer: Tag;
|
290
|
+
/**
|
291
|
+
A floating-point [number](#highlight.tags.number) literal.
|
292
|
+
*/
|
293
|
+
float: Tag;
|
294
|
+
/**
|
295
|
+
A boolean [literal](#highlight.tags.literal).
|
296
|
+
*/
|
297
|
+
bool: Tag;
|
298
|
+
/**
|
299
|
+
Regular expression [literal](#highlight.tags.literal).
|
300
|
+
*/
|
301
|
+
regexp: Tag;
|
302
|
+
/**
|
303
|
+
An escape [literal](#highlight.tags.literal), for example a
|
304
|
+
backslash escape in a string.
|
305
|
+
*/
|
306
|
+
escape: Tag;
|
307
|
+
/**
|
308
|
+
A color [literal](#highlight.tags.literal).
|
309
|
+
*/
|
310
|
+
color: Tag;
|
311
|
+
/**
|
312
|
+
A URL [literal](#highlight.tags.literal).
|
313
|
+
*/
|
314
|
+
url: Tag;
|
315
|
+
/**
|
316
|
+
A language keyword.
|
317
|
+
*/
|
318
|
+
keyword: Tag;
|
319
|
+
/**
|
320
|
+
The [keyword](#highlight.tags.keyword) for the self or this
|
321
|
+
object.
|
322
|
+
*/
|
323
|
+
self: Tag;
|
324
|
+
/**
|
325
|
+
The [keyword](#highlight.tags.keyword) for null.
|
326
|
+
*/
|
327
|
+
null: Tag;
|
328
|
+
/**
|
329
|
+
A [keyword](#highlight.tags.keyword) denoting some atomic value.
|
330
|
+
*/
|
331
|
+
atom: Tag;
|
332
|
+
/**
|
333
|
+
A [keyword](#highlight.tags.keyword) that represents a unit.
|
334
|
+
*/
|
335
|
+
unit: Tag;
|
336
|
+
/**
|
337
|
+
A modifier [keyword](#highlight.tags.keyword).
|
338
|
+
*/
|
339
|
+
modifier: Tag;
|
340
|
+
/**
|
341
|
+
A [keyword](#highlight.tags.keyword) that acts as an operator.
|
342
|
+
*/
|
343
|
+
operatorKeyword: Tag;
|
344
|
+
/**
|
345
|
+
A control-flow related [keyword](#highlight.tags.keyword).
|
346
|
+
*/
|
347
|
+
controlKeyword: Tag;
|
348
|
+
/**
|
349
|
+
A [keyword](#highlight.tags.keyword) that defines something.
|
350
|
+
*/
|
351
|
+
definitionKeyword: Tag;
|
352
|
+
/**
|
353
|
+
A [keyword](#highlight.tags.keyword) related to defining or
|
354
|
+
interfacing with modules.
|
355
|
+
*/
|
356
|
+
moduleKeyword: Tag;
|
357
|
+
/**
|
358
|
+
An operator.
|
359
|
+
*/
|
360
|
+
operator: Tag;
|
361
|
+
/**
|
362
|
+
An [operator](#highlight.tags.operator) that dereferences something.
|
363
|
+
*/
|
364
|
+
derefOperator: Tag;
|
365
|
+
/**
|
366
|
+
Arithmetic-related [operator](#highlight.tags.operator).
|
367
|
+
*/
|
368
|
+
arithmeticOperator: Tag;
|
369
|
+
/**
|
370
|
+
Logical [operator](#highlight.tags.operator).
|
371
|
+
*/
|
372
|
+
logicOperator: Tag;
|
373
|
+
/**
|
374
|
+
Bit [operator](#highlight.tags.operator).
|
375
|
+
*/
|
376
|
+
bitwiseOperator: Tag;
|
377
|
+
/**
|
378
|
+
Comparison [operator](#highlight.tags.operator).
|
379
|
+
*/
|
380
|
+
compareOperator: Tag;
|
381
|
+
/**
|
382
|
+
[Operator](#highlight.tags.operator) that updates its operand.
|
383
|
+
*/
|
384
|
+
updateOperator: Tag;
|
385
|
+
/**
|
386
|
+
[Operator](#highlight.tags.operator) that defines something.
|
387
|
+
*/
|
388
|
+
definitionOperator: Tag;
|
389
|
+
/**
|
390
|
+
Type-related [operator](#highlight.tags.operator).
|
391
|
+
*/
|
392
|
+
typeOperator: Tag;
|
393
|
+
/**
|
394
|
+
Control-flow [operator](#highlight.tags.operator).
|
395
|
+
*/
|
396
|
+
controlOperator: Tag;
|
397
|
+
/**
|
398
|
+
Program or markup punctuation.
|
399
|
+
*/
|
400
|
+
punctuation: Tag;
|
401
|
+
/**
|
402
|
+
[Punctuation](#highlight.tags.punctuation) that separates
|
403
|
+
things.
|
404
|
+
*/
|
405
|
+
separator: Tag;
|
406
|
+
/**
|
407
|
+
Bracket-style [punctuation](#highlight.tags.punctuation).
|
408
|
+
*/
|
409
|
+
bracket: Tag;
|
410
|
+
/**
|
411
|
+
Angle [brackets](#highlight.tags.bracket) (usually `<` and `>`
|
412
|
+
tokens).
|
413
|
+
*/
|
414
|
+
angleBracket: Tag;
|
415
|
+
/**
|
416
|
+
Square [brackets](#highlight.tags.bracket) (usually `[` and `]`
|
417
|
+
tokens).
|
418
|
+
*/
|
419
|
+
squareBracket: Tag;
|
420
|
+
/**
|
421
|
+
Parentheses (usually `(` and `)` tokens). Subtag of
|
422
|
+
[bracket](#highlight.tags.bracket).
|
423
|
+
*/
|
424
|
+
paren: Tag;
|
425
|
+
/**
|
426
|
+
Braces (usually `{` and `}` tokens). Subtag of
|
427
|
+
[bracket](#highlight.tags.bracket).
|
428
|
+
*/
|
429
|
+
brace: Tag;
|
430
|
+
/**
|
431
|
+
Content, for example plain text in XML or markup documents.
|
432
|
+
*/
|
433
|
+
content: Tag;
|
434
|
+
/**
|
435
|
+
[Content](#highlight.tags.content) that represents a heading.
|
436
|
+
*/
|
437
|
+
heading: Tag;
|
438
|
+
/**
|
439
|
+
A level 1 [heading](#highlight.tags.heading).
|
440
|
+
*/
|
441
|
+
heading1: Tag;
|
442
|
+
/**
|
443
|
+
A level 2 [heading](#highlight.tags.heading).
|
444
|
+
*/
|
445
|
+
heading2: Tag;
|
446
|
+
/**
|
447
|
+
A level 3 [heading](#highlight.tags.heading).
|
448
|
+
*/
|
449
|
+
heading3: Tag;
|
450
|
+
/**
|
451
|
+
A level 4 [heading](#highlight.tags.heading).
|
452
|
+
*/
|
453
|
+
heading4: Tag;
|
454
|
+
/**
|
455
|
+
A level 5 [heading](#highlight.tags.heading).
|
456
|
+
*/
|
457
|
+
heading5: Tag;
|
458
|
+
/**
|
459
|
+
A level 6 [heading](#highlight.tags.heading).
|
460
|
+
*/
|
461
|
+
heading6: Tag;
|
462
|
+
/**
|
463
|
+
A prose separator (such as a horizontal rule).
|
464
|
+
*/
|
465
|
+
contentSeparator: Tag;
|
466
|
+
/**
|
467
|
+
[Content](#highlight.tags.content) that represents a list.
|
468
|
+
*/
|
469
|
+
list: Tag;
|
470
|
+
/**
|
471
|
+
[Content](#highlight.tags.content) that represents a quote.
|
472
|
+
*/
|
473
|
+
quote: Tag;
|
474
|
+
/**
|
475
|
+
[Content](#highlight.tags.content) that is emphasized.
|
476
|
+
*/
|
477
|
+
emphasis: Tag;
|
478
|
+
/**
|
479
|
+
[Content](#highlight.tags.content) that is styled strong.
|
480
|
+
*/
|
481
|
+
strong: Tag;
|
482
|
+
/**
|
483
|
+
[Content](#highlight.tags.content) that is part of a link.
|
484
|
+
*/
|
485
|
+
link: Tag;
|
486
|
+
/**
|
487
|
+
[Content](#highlight.tags.content) that is styled as code or
|
488
|
+
monospace.
|
489
|
+
*/
|
490
|
+
monospace: Tag;
|
491
|
+
/**
|
492
|
+
[Content](#highlight.tags.content) that has a strike-through
|
493
|
+
style.
|
494
|
+
*/
|
495
|
+
strikethrough: Tag;
|
496
|
+
/**
|
497
|
+
Inserted text in a change-tracking format.
|
498
|
+
*/
|
499
|
+
inserted: Tag;
|
500
|
+
/**
|
501
|
+
Deleted text.
|
502
|
+
*/
|
503
|
+
deleted: Tag;
|
504
|
+
/**
|
505
|
+
Changed text.
|
506
|
+
*/
|
507
|
+
changed: Tag;
|
508
|
+
/**
|
509
|
+
An invalid or unsyntactic element.
|
510
|
+
*/
|
511
|
+
invalid: Tag;
|
512
|
+
/**
|
513
|
+
Metadata or meta-instruction.
|
514
|
+
*/
|
515
|
+
meta: Tag;
|
516
|
+
/**
|
517
|
+
[Metadata](#highlight.tags.meta) that applies to the entire
|
518
|
+
document.
|
519
|
+
*/
|
520
|
+
documentMeta: Tag;
|
521
|
+
/**
|
522
|
+
[Metadata](#highlight.tags.meta) that annotates or adds
|
523
|
+
attributes to a given syntactic element.
|
524
|
+
*/
|
525
|
+
annotation: Tag;
|
526
|
+
/**
|
527
|
+
Processing instruction or preprocessor directive. Subtag of
|
528
|
+
[meta](#highlight.tags.meta).
|
529
|
+
*/
|
530
|
+
processingInstruction: Tag;
|
531
|
+
/**
|
532
|
+
[Modifier](#highlight.Tag^defineModifier) that indicates that a
|
533
|
+
given element is being defined. Expected to be used with the
|
534
|
+
various [name](#highlight.tags.name) tags.
|
535
|
+
*/
|
536
|
+
definition: (tag: Tag) => Tag;
|
537
|
+
/**
|
538
|
+
[Modifier](#highlight.Tag^defineModifier) that indicates that
|
539
|
+
something is constant. Mostly expected to be used with
|
540
|
+
[variable names](#highlight.tags.variableName).
|
541
|
+
*/
|
542
|
+
constant: (tag: Tag) => Tag;
|
543
|
+
/**
|
544
|
+
[Modifier](#highlight.Tag^defineModifier) used to indicate that
|
545
|
+
a [variable](#highlight.tags.variableName) or [property
|
546
|
+
name](#highlight.tags.propertyName) is being called or defined
|
547
|
+
as a function.
|
548
|
+
*/
|
549
|
+
function: (tag: Tag) => Tag;
|
550
|
+
/**
|
551
|
+
[Modifier](#highlight.Tag^defineModifier) that can be applied to
|
552
|
+
[names](#highlight.tags.name) to indicate that they belong to
|
553
|
+
the language's standard environment.
|
554
|
+
*/
|
555
|
+
standard: (tag: Tag) => Tag;
|
556
|
+
/**
|
557
|
+
[Modifier](#highlight.Tag^defineModifier) that indicates a given
|
558
|
+
[names](#highlight.tags.name) is local to some scope.
|
559
|
+
*/
|
560
|
+
local: (tag: Tag) => Tag;
|
561
|
+
/**
|
562
|
+
A generic variant [modifier](#highlight.Tag^defineModifier) that
|
563
|
+
can be used to tag language-specific alternative variants of
|
564
|
+
some common tag. It is recommended for themes to define special
|
565
|
+
forms of at least the [string](#highlight.tags.string) and
|
566
|
+
[variable name](#highlight.tags.variableName) tags, since those
|
567
|
+
come up a lot.
|
568
|
+
*/
|
569
|
+
special: (tag: Tag) => Tag;
|
570
|
+
};
|
571
|
+
/**
|
572
|
+
This is a highlighter that adds stable, predictable classes to
|
573
|
+
tokens, for styling with external CSS.
|
574
|
+
|
575
|
+
The following tags are mapped to their name prefixed with `"tok-"`
|
576
|
+
(for example `"tok-comment"`):
|
577
|
+
|
578
|
+
* [`link`](#highlight.tags.link)
|
579
|
+
* [`heading`](#highlight.tags.heading)
|
580
|
+
* [`emphasis`](#highlight.tags.emphasis)
|
581
|
+
* [`strong`](#highlight.tags.strong)
|
582
|
+
* [`keyword`](#highlight.tags.keyword)
|
583
|
+
* [`atom`](#highlight.tags.atom)
|
584
|
+
* [`bool`](#highlight.tags.bool)
|
585
|
+
* [`url`](#highlight.tags.url)
|
586
|
+
* [`labelName`](#highlight.tags.labelName)
|
587
|
+
* [`inserted`](#highlight.tags.inserted)
|
588
|
+
* [`deleted`](#highlight.tags.deleted)
|
589
|
+
* [`literal`](#highlight.tags.literal)
|
590
|
+
* [`string`](#highlight.tags.string)
|
591
|
+
* [`number`](#highlight.tags.number)
|
592
|
+
* [`variableName`](#highlight.tags.variableName)
|
593
|
+
* [`typeName`](#highlight.tags.typeName)
|
594
|
+
* [`namespace`](#highlight.tags.namespace)
|
595
|
+
* [`className`](#highlight.tags.className)
|
596
|
+
* [`macroName`](#highlight.tags.macroName)
|
597
|
+
* [`propertyName`](#highlight.tags.propertyName)
|
598
|
+
* [`operator`](#highlight.tags.operator)
|
599
|
+
* [`comment`](#highlight.tags.comment)
|
600
|
+
* [`meta`](#highlight.tags.meta)
|
601
|
+
* [`punctuation`](#highlight.tags.punctuation)
|
602
|
+
* [`invalid`](#highlight.tags.invalid)
|
603
|
+
|
604
|
+
In addition, these mappings are provided:
|
605
|
+
|
606
|
+
* [`regexp`](#highlight.tags.regexp),
|
607
|
+
[`escape`](#highlight.tags.escape), and
|
608
|
+
[`special`](#highlight.tags.special)[`(string)`](#highlight.tags.string)
|
609
|
+
are mapped to `"tok-string2"`
|
610
|
+
* [`special`](#highlight.tags.special)[`(variableName)`](#highlight.tags.variableName)
|
611
|
+
to `"tok-variableName2"`
|
612
|
+
* [`local`](#highlight.tags.local)[`(variableName)`](#highlight.tags.variableName)
|
613
|
+
to `"tok-variableName tok-local"`
|
614
|
+
* [`definition`](#highlight.tags.definition)[`(variableName)`](#highlight.tags.variableName)
|
615
|
+
to `"tok-variableName tok-definition"`
|
616
|
+
* [`definition`](#highlight.tags.definition)[`(propertyName)`](#highlight.tags.propertyName)
|
617
|
+
to `"tok-propertyName tok-definition"`
|
618
|
+
*/
|
619
|
+
declare const classHighlighter: Highlighter;
|
620
|
+
|
621
|
+
export { type Highlighter, Tag, classHighlighter, getStyleTags, highlightCode, highlightTree, styleTags, tagHighlighter, tags };
|