@oseo/compiler 0.0.0-stage → 0.1.0-canary.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.
- package/LICENSE +674 -0
- package/README.md +172 -2
- package/dist/agent-programs.d.ts +28 -0
- package/dist/agent-programs.d.ts.map +1 -0
- package/dist/agent-programs.js +134 -0
- package/dist/agent-programs.js.map +1 -0
- package/dist/agent-templates.d.ts +33 -0
- package/dist/agent-templates.d.ts.map +1 -0
- package/dist/agent-templates.js +45 -0
- package/dist/agent-templates.js.map +1 -0
- package/dist/compile.d.ts +20 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +75 -0
- package/dist/compile.js.map +1 -0
- package/dist/fragments.d.ts +72 -0
- package/dist/fragments.d.ts.map +1 -0
- package/dist/fragments.js +158 -0
- package/dist/fragments.js.map +1 -0
- package/dist/hir-build.d.ts +80 -0
- package/dist/hir-build.d.ts.map +1 -0
- package/dist/hir-build.js +3077 -0
- package/dist/hir-build.js.map +1 -0
- package/dist/hir-print.d.ts +10 -0
- package/dist/hir-print.d.ts.map +1 -0
- package/dist/hir-print.js +271 -0
- package/dist/hir-print.js.map +1 -0
- package/dist/hir.d.ts +1246 -0
- package/dist/hir.d.ts.map +1 -0
- package/dist/hir.js +147 -0
- package/dist/hir.js.map +1 -0
- package/dist/host-scripts.d.ts +14 -0
- package/dist/host-scripts.d.ts.map +1 -0
- package/dist/host-scripts.js +204 -0
- package/dist/host-scripts.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/mir-build.d.ts +8 -0
- package/dist/mir-build.d.ts.map +1 -0
- package/dist/mir-build.js +5113 -0
- package/dist/mir-build.js.map +1 -0
- package/dist/mir-print.d.ts +7 -0
- package/dist/mir-print.d.ts.map +1 -0
- package/dist/mir-print.js +65 -0
- package/dist/mir-print.js.map +1 -0
- package/dist/mir-specialize.d.ts +7 -0
- package/dist/mir-specialize.d.ts.map +1 -0
- package/dist/mir-specialize.js +182 -0
- package/dist/mir-specialize.js.map +1 -0
- package/dist/mir.d.ts +571 -0
- package/dist/mir.d.ts.map +1 -0
- package/dist/mir.js +1 -0
- package/dist/module-builtin.d.ts +20 -0
- package/dist/module-builtin.d.ts.map +1 -0
- package/dist/module-builtin.js +57 -0
- package/dist/module-builtin.js.map +1 -0
- package/dist/module-compile.d.ts +64 -0
- package/dist/module-compile.d.ts.map +1 -0
- package/dist/module-compile.js +690 -0
- package/dist/module-compile.js.map +1 -0
- package/dist/module-json.d.ts +7 -0
- package/dist/module-json.d.ts.map +1 -0
- package/dist/module-json.js +88 -0
- package/dist/module-json.js.map +1 -0
- package/dist/modules.d.ts +87 -0
- package/dist/modules.d.ts.map +1 -0
- package/dist/modules.js +734 -0
- package/dist/modules.js.map +1 -0
- package/dist/native-fragments.d.ts +36 -0
- package/dist/native-fragments.d.ts.map +1 -0
- package/dist/native-fragments.js +110 -0
- package/dist/native-fragments.js.map +1 -0
- package/dist/native.d.ts +282 -0
- package/dist/native.d.ts.map +1 -0
- package/dist/native.js +47 -0
- package/dist/native.js.map +1 -0
- package/dist/regexp-execute.d.ts +74 -0
- package/dist/regexp-execute.d.ts.map +1 -0
- package/dist/regexp-execute.js +480 -0
- package/dist/regexp-execute.js.map +1 -0
- package/dist/regexp-matcher.d.ts +279 -0
- package/dist/regexp-matcher.d.ts.map +1 -0
- package/dist/regexp-matcher.js +1098 -0
- package/dist/regexp-matcher.js.map +1 -0
- package/dist/regexp-parse.d.ts +22 -0
- package/dist/regexp-parse.d.ts.map +1 -0
- package/dist/regexp-parse.js +1440 -0
- package/dist/regexp-parse.js.map +1 -0
- package/dist/regexp-print.d.ts +24 -0
- package/dist/regexp-print.d.ts.map +1 -0
- package/dist/regexp-print.js +147 -0
- package/dist/regexp-print.js.map +1 -0
- package/dist/regexp.d.ts +324 -0
- package/dist/regexp.d.ts.map +1 -0
- package/dist/regexp.js +22 -0
- package/dist/regexp.js.map +1 -0
- package/dist/source.d.ts +38 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +10 -0
- package/dist/source.js.map +1 -0
- package/dist/syntax.d.ts +1232 -0
- package/dist/syntax.d.ts.map +1 -0
- package/dist/syntax.js +1 -0
- package/package.json +32 -3
package/dist/regexp.d.ts
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
//#region src/regexp.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* A half-open span of UTF-16 code units inside one pattern or flag text.
|
|
4
|
+
*
|
|
5
|
+
* Pattern spans are relative to the pattern text rather than to any
|
|
6
|
+
* enclosing source, so the same span is meaningful for a literal that a
|
|
7
|
+
* frontend maps back into its source and for a string that reaches the
|
|
8
|
+
* `RegExp` constructor at run time.
|
|
9
|
+
*/
|
|
10
|
+
interface RegExpSpan {
|
|
11
|
+
readonly end: number;
|
|
12
|
+
readonly start: number;
|
|
13
|
+
}
|
|
14
|
+
/** One regular expression flag admitted by the candidate edition. */
|
|
15
|
+
type RegExpFlag = "d" | "g" | "i" | "m" | "s" | "u" | "v" | "y";
|
|
16
|
+
/**
|
|
17
|
+
* The validated flag set of one pattern with its original text.
|
|
18
|
+
*
|
|
19
|
+
* `text` retains the flags exactly as written so that a later unit can
|
|
20
|
+
* implement `flags` and `toString` without reconstructing them from the
|
|
21
|
+
* decoded fields.
|
|
22
|
+
*/
|
|
23
|
+
interface RegExpFlags {
|
|
24
|
+
readonly dotAll: boolean;
|
|
25
|
+
readonly global: boolean;
|
|
26
|
+
readonly hasIndices: boolean;
|
|
27
|
+
readonly ignoreCase: boolean;
|
|
28
|
+
readonly multiline: boolean;
|
|
29
|
+
readonly sticky: boolean;
|
|
30
|
+
readonly text: string;
|
|
31
|
+
readonly unicode: boolean;
|
|
32
|
+
readonly unicodeSets: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** Whether a flag set selects the grammar's UnicodeMode parameter. */
|
|
35
|
+
declare function regExpUnicodeMode(flags: RegExpFlags): boolean;
|
|
36
|
+
/** An input-position assertion that consumes nothing. */
|
|
37
|
+
type RegExpAssertionKind = "end" | "non-word-boundary" | "start" | "word-boundary";
|
|
38
|
+
/** One `^`, `$`, `\b`, or `\B` assertion. */
|
|
39
|
+
interface RegExpEdgeAssertion {
|
|
40
|
+
readonly assertion: RegExpAssertionKind;
|
|
41
|
+
readonly kind: "assertion";
|
|
42
|
+
readonly span: RegExpSpan;
|
|
43
|
+
}
|
|
44
|
+
/** Direction one lookaround assertion searches from the current position. */
|
|
45
|
+
type RegExpLookaroundDirection = "ahead" | "behind";
|
|
46
|
+
/** One lookahead or lookbehind assertion with its own alternatives. */
|
|
47
|
+
interface RegExpLookaround {
|
|
48
|
+
readonly body: RegExpDisjunction;
|
|
49
|
+
readonly direction: RegExpLookaroundDirection;
|
|
50
|
+
readonly kind: "lookaround";
|
|
51
|
+
readonly negated: boolean;
|
|
52
|
+
readonly span: RegExpSpan;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* One repetition bound pair with its choice priority.
|
|
56
|
+
*
|
|
57
|
+
* `maximum` is `Number.POSITIVE_INFINITY` for an unbounded repetition, so
|
|
58
|
+
* a consumer compares bounds without a separate presence flag. `greedy`
|
|
59
|
+
* records the observable choice order rather than a matching strategy.
|
|
60
|
+
*/
|
|
61
|
+
interface RegExpQuantifier {
|
|
62
|
+
readonly greedy: boolean;
|
|
63
|
+
readonly maximum: number;
|
|
64
|
+
readonly minimum: number;
|
|
65
|
+
readonly span: RegExpSpan;
|
|
66
|
+
}
|
|
67
|
+
/** One atom with the quantifier that repeats it. */
|
|
68
|
+
interface RegExpQuantified {
|
|
69
|
+
readonly atom: RegExpAtom;
|
|
70
|
+
readonly kind: "quantified";
|
|
71
|
+
readonly quantifier: RegExpQuantifier;
|
|
72
|
+
readonly span: RegExpSpan;
|
|
73
|
+
}
|
|
74
|
+
/** One literal code point, however it was written. */
|
|
75
|
+
interface RegExpCharacter {
|
|
76
|
+
readonly kind: "character";
|
|
77
|
+
readonly span: RegExpSpan;
|
|
78
|
+
readonly value: number;
|
|
79
|
+
}
|
|
80
|
+
/** One `.` atom, whose matched set depends on the `s` flag. */
|
|
81
|
+
interface RegExpDot {
|
|
82
|
+
readonly kind: "dot";
|
|
83
|
+
readonly span: RegExpSpan;
|
|
84
|
+
}
|
|
85
|
+
/** The three character class escapes that need no Unicode property name. */
|
|
86
|
+
type RegExpClassEscapeSet = "digit" | "space" | "word";
|
|
87
|
+
/** One `\d`, `\D`, `\s`, `\S`, `\w`, or `\W` escape. */
|
|
88
|
+
interface RegExpClassEscape {
|
|
89
|
+
readonly kind: "class-escape";
|
|
90
|
+
readonly negated: boolean;
|
|
91
|
+
readonly set: RegExpClassEscapeSet;
|
|
92
|
+
readonly span: RegExpSpan;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* One `\p{...}` or `\P{...}` escape.
|
|
96
|
+
*
|
|
97
|
+
* The parser records the written property name and optional value without
|
|
98
|
+
* resolving either against Unicode data. Resolution belongs to the unit
|
|
99
|
+
* that links the pinned tables, which supplies
|
|
100
|
+
* {@link RegExpPatternExtensions.unicodeProperty}.
|
|
101
|
+
*/
|
|
102
|
+
interface RegExpUnicodePropertyEscape {
|
|
103
|
+
readonly kind: "unicode-property";
|
|
104
|
+
readonly negated: boolean;
|
|
105
|
+
readonly property: string;
|
|
106
|
+
readonly span: RegExpSpan;
|
|
107
|
+
readonly value?: string;
|
|
108
|
+
}
|
|
109
|
+
/** One inclusive code-point range inside a character class. */
|
|
110
|
+
interface RegExpCharacterRange {
|
|
111
|
+
readonly end: RegExpCharacter;
|
|
112
|
+
readonly kind: "range";
|
|
113
|
+
readonly span: RegExpSpan;
|
|
114
|
+
readonly start: RegExpCharacter;
|
|
115
|
+
}
|
|
116
|
+
/** One member of a character class body. */
|
|
117
|
+
type RegExpClassItem = RegExpCharacter | RegExpCharacterRange | RegExpClassEscape | RegExpUnicodePropertyEscape;
|
|
118
|
+
/** One `[...]` or `[^...]` character class. */
|
|
119
|
+
interface RegExpCharacterClass {
|
|
120
|
+
readonly items: readonly RegExpClassItem[];
|
|
121
|
+
readonly kind: "character-class";
|
|
122
|
+
readonly negated: boolean;
|
|
123
|
+
readonly span: RegExpSpan;
|
|
124
|
+
}
|
|
125
|
+
/** One finite string alternative inside a `v`-mode `\q{...}` operand. */
|
|
126
|
+
interface RegExpClassStringDisjunction {
|
|
127
|
+
readonly kind: "class-strings";
|
|
128
|
+
readonly span: RegExpSpan;
|
|
129
|
+
readonly strings: readonly (readonly RegExpCharacter[])[];
|
|
130
|
+
}
|
|
131
|
+
/** One operand of a `v`-mode class-set expression. */
|
|
132
|
+
type RegExpClassSetOperand = RegExpCharacter | RegExpCharacterRange | RegExpClassEscape | RegExpClassStringDisjunction | RegExpUnicodeClassSet | RegExpUnicodePropertyEscape;
|
|
133
|
+
/** The operation joining operands in one `v`-mode character class. */
|
|
134
|
+
type RegExpClassSetOperation = "intersection" | "subtraction" | "union";
|
|
135
|
+
/** One nested or top-level `v`-mode class-set expression. */
|
|
136
|
+
interface RegExpUnicodeClassSet {
|
|
137
|
+
readonly kind: "class-set";
|
|
138
|
+
readonly negated: boolean;
|
|
139
|
+
readonly operands: readonly RegExpClassSetOperand[];
|
|
140
|
+
readonly operation: RegExpClassSetOperation;
|
|
141
|
+
readonly span: RegExpSpan;
|
|
142
|
+
}
|
|
143
|
+
/** One capturing group with its one-based index and optional name. */
|
|
144
|
+
interface RegExpCapturingGroup {
|
|
145
|
+
readonly body: RegExpDisjunction;
|
|
146
|
+
readonly index: number;
|
|
147
|
+
readonly kind: "capturing-group";
|
|
148
|
+
readonly name?: string;
|
|
149
|
+
readonly span: RegExpSpan;
|
|
150
|
+
}
|
|
151
|
+
/** One `(?:...)` group, which holds alternatives without capturing. */
|
|
152
|
+
interface RegExpGroup {
|
|
153
|
+
readonly body: RegExpDisjunction;
|
|
154
|
+
readonly kind: "group";
|
|
155
|
+
readonly span: RegExpSpan;
|
|
156
|
+
}
|
|
157
|
+
/** One flag an inline modifier group may add or remove. */
|
|
158
|
+
type RegExpModifierFlag = "i" | "m" | "s";
|
|
159
|
+
/**
|
|
160
|
+
* One `(?ims-ims:...)` group.
|
|
161
|
+
*
|
|
162
|
+
* The group holds alternatives like `(?:...)` and changes the flags that
|
|
163
|
+
* apply inside it. `enabled` and `disabled` are disjoint and at least one
|
|
164
|
+
* of them is nonempty.
|
|
165
|
+
*/
|
|
166
|
+
interface RegExpModifierGroup {
|
|
167
|
+
readonly body: RegExpDisjunction;
|
|
168
|
+
readonly disabled: readonly RegExpModifierFlag[];
|
|
169
|
+
readonly enabled: readonly RegExpModifierFlag[];
|
|
170
|
+
readonly kind: "modifier-group";
|
|
171
|
+
readonly span: RegExpSpan;
|
|
172
|
+
}
|
|
173
|
+
/** One `\1`-style reference to a numbered capturing group. */
|
|
174
|
+
interface RegExpBackreference {
|
|
175
|
+
readonly index: number;
|
|
176
|
+
readonly kind: "backreference";
|
|
177
|
+
readonly span: RegExpSpan;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* One `\k<name>` reference.
|
|
181
|
+
*
|
|
182
|
+
* The candidate edition permits one name on several groups when they
|
|
183
|
+
* cannot both participate in a match, so a named reference resolves to
|
|
184
|
+
* every group carrying the name, in ascending index order.
|
|
185
|
+
*/
|
|
186
|
+
interface RegExpNamedBackreference {
|
|
187
|
+
readonly indices: readonly number[];
|
|
188
|
+
readonly kind: "named-backreference";
|
|
189
|
+
readonly name: string;
|
|
190
|
+
readonly span: RegExpSpan;
|
|
191
|
+
}
|
|
192
|
+
/** One pattern element that a quantifier may repeat. */
|
|
193
|
+
type RegExpAtom = RegExpBackreference | RegExpCapturingGroup | RegExpCharacter | RegExpCharacterClass | RegExpUnicodeClassSet | RegExpClassEscape | RegExpDot | RegExpGroup | RegExpModifierGroup | RegExpNamedBackreference | RegExpUnicodePropertyEscape;
|
|
194
|
+
/** One element of an alternative, in written order. */
|
|
195
|
+
type RegExpTerm = RegExpAtom | RegExpEdgeAssertion | RegExpLookaround | RegExpQuantified;
|
|
196
|
+
/** One alternative: an ordered, possibly empty term sequence. */
|
|
197
|
+
interface RegExpAlternative {
|
|
198
|
+
readonly kind: "alternative";
|
|
199
|
+
readonly span: RegExpSpan;
|
|
200
|
+
readonly terms: readonly RegExpTerm[];
|
|
201
|
+
}
|
|
202
|
+
/** Ordered alternatives whose order is the observable choice priority. */
|
|
203
|
+
interface RegExpDisjunction {
|
|
204
|
+
readonly alternatives: readonly RegExpAlternative[];
|
|
205
|
+
readonly kind: "disjunction";
|
|
206
|
+
readonly span: RegExpSpan;
|
|
207
|
+
}
|
|
208
|
+
/** One capturing group recorded in ascending index order. */
|
|
209
|
+
interface RegExpCapture {
|
|
210
|
+
readonly index: number;
|
|
211
|
+
readonly name?: string;
|
|
212
|
+
readonly span: RegExpSpan;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* One validated pattern with the metadata a later unit needs.
|
|
216
|
+
*
|
|
217
|
+
* `source` and `flags.text` retain the original text, so `source`,
|
|
218
|
+
* `flags`, and `toString` never reconstruct text from the tree.
|
|
219
|
+
*/
|
|
220
|
+
interface RegExpPattern {
|
|
221
|
+
readonly body: RegExpDisjunction;
|
|
222
|
+
readonly captures: readonly RegExpCapture[];
|
|
223
|
+
readonly flags: RegExpFlags;
|
|
224
|
+
readonly groupNames: readonly string[];
|
|
225
|
+
readonly kind: "pattern";
|
|
226
|
+
readonly source: string;
|
|
227
|
+
}
|
|
228
|
+
/** Whether a rejected construct is invalid, unadmitted, or over a limit. */
|
|
229
|
+
type RegExpErrorKind = "invalid" | "limit" | "unsupported";
|
|
230
|
+
/** Which text of a pattern one error span addresses. */
|
|
231
|
+
type RegExpErrorSection = "flags" | "pattern";
|
|
232
|
+
/**
|
|
233
|
+
* One rejected construct located inside the pattern or flag text.
|
|
234
|
+
*
|
|
235
|
+
* `kind` separates the three reasons a caller must distinguish. An
|
|
236
|
+
* `invalid` construct is an ECMA-262 early error, so a literal reports it
|
|
237
|
+
* as a parse rejection and a dynamic pattern throws `SyntaxError`. An
|
|
238
|
+
* `unsupported` construct is valid syntax that this unit does not admit,
|
|
239
|
+
* and a `limit` construct exceeds an owned resource boundary.
|
|
240
|
+
*/
|
|
241
|
+
interface RegExpPatternError {
|
|
242
|
+
readonly kind: RegExpErrorKind;
|
|
243
|
+
readonly message: string;
|
|
244
|
+
readonly section: RegExpErrorSection;
|
|
245
|
+
readonly span: RegExpSpan;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* A construct this unit parses but does not admit by default.
|
|
249
|
+
*
|
|
250
|
+
* The parser recognizes each construct and refuses it with a located
|
|
251
|
+
* `unsupported` error unless the caller admits the point. Admitting a
|
|
252
|
+
* point never changes how any other construct parses.
|
|
253
|
+
*/
|
|
254
|
+
type RegExpExtensionPoint = "class-set-notation" | "modifiers" | "unicode-property-escapes";
|
|
255
|
+
/**
|
|
256
|
+
* Capabilities a caller supplies to the pattern parser.
|
|
257
|
+
*
|
|
258
|
+
* The compiler core links no Unicode data, so a construct whose validity
|
|
259
|
+
* depends on it is either refused or delegated here. `identifierStart`
|
|
260
|
+
* and `identifierPart` classify a group-name code point outside ASCII;
|
|
261
|
+
* without them such a name is refused rather than guessed.
|
|
262
|
+
* `unicodeProperty` decides whether one escape names a defined property,
|
|
263
|
+
* and admitting `unicode-property-escapes` without it refuses the escape
|
|
264
|
+
* rather than accepting a name nothing checked.
|
|
265
|
+
*/
|
|
266
|
+
interface RegExpPatternExtensions {
|
|
267
|
+
readonly admitted: readonly RegExpExtensionPoint[];
|
|
268
|
+
readonly identifierPart?: (codePoint: number) => boolean;
|
|
269
|
+
readonly identifierStart?: (codePoint: number) => boolean;
|
|
270
|
+
readonly unicodeProperty?: (escape: RegExpUnicodePropertyEscape) => boolean;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Owned resource boundaries applied while parsing one pattern.
|
|
274
|
+
*
|
|
275
|
+
* ECMA-262 bounds none of these, so each limit is an implementation
|
|
276
|
+
* boundary that reports a located `limit` error instead of exhausting a
|
|
277
|
+
* host stack or overflowing a later matcher's capture representation.
|
|
278
|
+
*/
|
|
279
|
+
interface RegExpPatternLimits {
|
|
280
|
+
readonly capturingGroups: number;
|
|
281
|
+
readonly nestingDepth: number;
|
|
282
|
+
readonly quantifierBound: number;
|
|
283
|
+
readonly sourceLength: number;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* The reviewed default limits.
|
|
287
|
+
*
|
|
288
|
+
* `capturingGroups` keeps a capture index inside 16 bits, `nestingDepth`
|
|
289
|
+
* bounds the parser's recursion, `quantifierBound` keeps a repetition
|
|
290
|
+
* count exactly representable, and `sourceLength` bounds one pattern text.
|
|
291
|
+
*/
|
|
292
|
+
declare const defaultRegExpPatternLimits: RegExpPatternLimits;
|
|
293
|
+
/** Optional components shared by every pattern parse entry point. */
|
|
294
|
+
interface RegExpPatternOptions {
|
|
295
|
+
/**
|
|
296
|
+
* Whether a pattern without `u` or `v` follows the grammar of Annex B's
|
|
297
|
+
* Regular Expressions Patterns section, as the edition requires of a web
|
|
298
|
+
* browser host. It is on unless a caller asks for the core grammar
|
|
299
|
+
* alone, which then reports every construct only Annex B admits as an
|
|
300
|
+
* `unsupported` error. Under `u` or `v` the option changes nothing.
|
|
301
|
+
*/
|
|
302
|
+
readonly annexB?: boolean;
|
|
303
|
+
readonly extensions?: RegExpPatternExtensions;
|
|
304
|
+
readonly limits?: RegExpPatternLimits;
|
|
305
|
+
}
|
|
306
|
+
/** One pattern text and flag text presented to the parser. */
|
|
307
|
+
interface RegExpPatternInput extends RegExpPatternOptions {
|
|
308
|
+
readonly flags: string;
|
|
309
|
+
readonly source: string;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* The outcome of one parse.
|
|
313
|
+
*
|
|
314
|
+
* `pattern` is present exactly when `parsed` is true, and `errors` is
|
|
315
|
+
* nonempty exactly when it is false.
|
|
316
|
+
*/
|
|
317
|
+
interface RegExpPatternResult {
|
|
318
|
+
readonly errors: readonly RegExpPatternError[];
|
|
319
|
+
readonly parsed: boolean;
|
|
320
|
+
readonly pattern?: RegExpPattern;
|
|
321
|
+
}
|
|
322
|
+
//#endregion
|
|
323
|
+
export { RegExpAlternative, RegExpAssertionKind, RegExpAtom, RegExpBackreference, RegExpCapture, RegExpCapturingGroup, RegExpCharacter, RegExpCharacterClass, RegExpCharacterRange, RegExpClassEscape, RegExpClassEscapeSet, RegExpClassItem, RegExpClassSetOperand, RegExpClassSetOperation, RegExpClassStringDisjunction, RegExpDisjunction, RegExpDot, RegExpEdgeAssertion, RegExpErrorKind, RegExpErrorSection, RegExpExtensionPoint, RegExpFlag, RegExpFlags, RegExpGroup, RegExpLookaround, RegExpLookaroundDirection, RegExpModifierFlag, RegExpModifierGroup, RegExpNamedBackreference, RegExpPattern, RegExpPatternError, RegExpPatternExtensions, RegExpPatternInput, RegExpPatternLimits, RegExpPatternOptions, RegExpPatternResult, RegExpQuantified, RegExpQuantifier, RegExpSpan, RegExpTerm, RegExpUnicodeClassSet, RegExpUnicodePropertyEscape, defaultRegExpPatternLimits, regExpUnicodeMode };
|
|
324
|
+
//# sourceMappingURL=regexp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regexp.d.ts","names":[],"sources":["../src/regexp.ts"],"mappings":";;;;;;;;;UAQiB;WACN;WACA;;;KAIC;;;;;;;;UASK;WACN;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;iBAIK,kBAAkB,OAAO;;KAK7B;;UAOK;WACN,WAAW;WACX;WACA,MAAM;;;KAIL;;UAGK;WACN,MAAM;WACN,WAAW;WACX;WACA;WACA,MAAM;;;;;;;;;UAUA;WACN;WACA;WACA;WACA,MAAM;;;UAIA;WACN,MAAM;WACN;WACA,YAAY;WACZ,MAAM;;;UAIA;WACN;WACA,MAAM;WACN;;;UAIM;WACN;WACA,MAAM;;;KAIL;;UAGK;WACN;WACA;WACA,KAAK;WACL,MAAM;;;;;;;;;;UAWA;WACN;WACA;WACA;WACA,MAAM;WACN;;;UAIM;WACN,KAAK;WACL;WACA,MAAM;WACN,OAAO;;;KAIN,kBACR,kBACA,uBACA,oBACA;;UAGa;WACN,gBAAgB;WAChB;WACA;WACA,MAAM;;;UAIA;WACN;WACA,MAAM;WACN,4BAA4B;;;KAI3B,wBACR,kBACA,uBACA,oBACA,+BACA,wBACA;;KAGQ;;UAGK;WACN;WACA;WACA,mBAAmB;WACnB,WAAW;WACX,MAAM;;;UAIA;WACN,MAAM;WACN;WACA;WACA;WACA,MAAM;;;UAIA;WACN,MAAM;WACN;WACA,MAAM;;;KAIL;;;;;;;;UASK;WACN,MAAM;WACN,mBAAmB;WACnB,kBAAkB;WAClB;WACA,MAAM;;;UAIA;WACN;WACA;WACA,MAAM;;;;;;;;;UAUA;WACN;WACA;WACA;WACA,MAAM;;;KAIL,aACR,sBACA,uBACA,kBACA,uBACA,wBACA,oBACA,YACA,cACA,sBACA,2BACA;;KAGQ,aACR,aACA,sBACA,mBACA;;UAGa;WACN;WACA,MAAM;WACN,gBAAgB;;;UAIV;WACN,uBAAuB;WACvB;WACA,MAAM;;;UAIA;WACN;WACA;WACA,MAAM;;;;;;;;UASA;WACN,MAAM;WACN,mBAAmB;WACnB,OAAO;WACP;WACA;WACA;;;KAIC;;KAGA;;;;;;;;;;UAWK;WACN,MAAM;WACN;WACA,SAAS;WACT,MAAM;;;;;;;;;KAUL;;;;;;;;;;;;UAgBK;WACN,mBAAmB;WACnB,kBAAkB;WAClB,mBAAmB;WACnB,mBAAmB,QAAQ;;;;;;;;;UAUrB;WACN;WACA;WACA;WACA;;;;;;;;;cAUE,4BAA4B;;UAQxB;;;;;;;;WAQN;WACA,aAAa;WACb,SAAS;;;UAIH,2BAA2B;WACjC;WACA;;;;;;;;UASM;WACN,iBAAiB;WACjB;WACA,UAAU"}
|
package/dist/regexp.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/regexp.ts
|
|
2
|
+
/** Whether a flag set selects the grammar's UnicodeMode parameter. */
|
|
3
|
+
function regExpUnicodeMode(flags) {
|
|
4
|
+
return flags.unicode || flags.unicodeSets;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The reviewed default limits.
|
|
8
|
+
*
|
|
9
|
+
* `capturingGroups` keeps a capture index inside 16 bits, `nestingDepth`
|
|
10
|
+
* bounds the parser's recursion, `quantifierBound` keeps a repetition
|
|
11
|
+
* count exactly representable, and `sourceLength` bounds one pattern text.
|
|
12
|
+
*/
|
|
13
|
+
const defaultRegExpPatternLimits = {
|
|
14
|
+
capturingGroups: 65535,
|
|
15
|
+
nestingDepth: 256,
|
|
16
|
+
quantifierBound: Number.MAX_SAFE_INTEGER,
|
|
17
|
+
sourceLength: 1048576
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { defaultRegExpPatternLimits, regExpUnicodeMode };
|
|
22
|
+
//# sourceMappingURL=regexp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regexp.js","names":[],"sources":["../src/regexp.ts"],"sourcesContent":["/**\n * A half-open span of UTF-16 code units inside one pattern or flag text.\n *\n * Pattern spans are relative to the pattern text rather than to any\n * enclosing source, so the same span is meaningful for a literal that a\n * frontend maps back into its source and for a string that reaches the\n * `RegExp` constructor at run time.\n */\nexport interface RegExpSpan {\n readonly end: number;\n readonly start: number;\n}\n\n/** One regular expression flag admitted by the candidate edition. */\nexport type RegExpFlag = \"d\" | \"g\" | \"i\" | \"m\" | \"s\" | \"u\" | \"v\" | \"y\";\n\n/**\n * The validated flag set of one pattern with its original text.\n *\n * `text` retains the flags exactly as written so that a later unit can\n * implement `flags` and `toString` without reconstructing them from the\n * decoded fields.\n */\nexport interface RegExpFlags {\n readonly dotAll: boolean;\n readonly global: boolean;\n readonly hasIndices: boolean;\n readonly ignoreCase: boolean;\n readonly multiline: boolean;\n readonly sticky: boolean;\n readonly text: string;\n readonly unicode: boolean;\n readonly unicodeSets: boolean;\n}\n\n/** Whether a flag set selects the grammar's UnicodeMode parameter. */\nexport function regExpUnicodeMode(flags: RegExpFlags): boolean {\n return flags.unicode || flags.unicodeSets;\n}\n\n/** An input-position assertion that consumes nothing. */\nexport type RegExpAssertionKind =\n | \"end\"\n | \"non-word-boundary\"\n | \"start\"\n | \"word-boundary\";\n\n/** One `^`, `$`, `\\b`, or `\\B` assertion. */\nexport interface RegExpEdgeAssertion {\n readonly assertion: RegExpAssertionKind;\n readonly kind: \"assertion\";\n readonly span: RegExpSpan;\n}\n\n/** Direction one lookaround assertion searches from the current position. */\nexport type RegExpLookaroundDirection = \"ahead\" | \"behind\";\n\n/** One lookahead or lookbehind assertion with its own alternatives. */\nexport interface RegExpLookaround {\n readonly body: RegExpDisjunction;\n readonly direction: RegExpLookaroundDirection;\n readonly kind: \"lookaround\";\n readonly negated: boolean;\n readonly span: RegExpSpan;\n}\n\n/**\n * One repetition bound pair with its choice priority.\n *\n * `maximum` is `Number.POSITIVE_INFINITY` for an unbounded repetition, so\n * a consumer compares bounds without a separate presence flag. `greedy`\n * records the observable choice order rather than a matching strategy.\n */\nexport interface RegExpQuantifier {\n readonly greedy: boolean;\n readonly maximum: number;\n readonly minimum: number;\n readonly span: RegExpSpan;\n}\n\n/** One atom with the quantifier that repeats it. */\nexport interface RegExpQuantified {\n readonly atom: RegExpAtom;\n readonly kind: \"quantified\";\n readonly quantifier: RegExpQuantifier;\n readonly span: RegExpSpan;\n}\n\n/** One literal code point, however it was written. */\nexport interface RegExpCharacter {\n readonly kind: \"character\";\n readonly span: RegExpSpan;\n readonly value: number;\n}\n\n/** One `.` atom, whose matched set depends on the `s` flag. */\nexport interface RegExpDot {\n readonly kind: \"dot\";\n readonly span: RegExpSpan;\n}\n\n/** The three character class escapes that need no Unicode property name. */\nexport type RegExpClassEscapeSet = \"digit\" | \"space\" | \"word\";\n\n/** One `\\d`, `\\D`, `\\s`, `\\S`, `\\w`, or `\\W` escape. */\nexport interface RegExpClassEscape {\n readonly kind: \"class-escape\";\n readonly negated: boolean;\n readonly set: RegExpClassEscapeSet;\n readonly span: RegExpSpan;\n}\n\n/**\n * One `\\p{...}` or `\\P{...}` escape.\n *\n * The parser records the written property name and optional value without\n * resolving either against Unicode data. Resolution belongs to the unit\n * that links the pinned tables, which supplies\n * {@link RegExpPatternExtensions.unicodeProperty}.\n */\nexport interface RegExpUnicodePropertyEscape {\n readonly kind: \"unicode-property\";\n readonly negated: boolean;\n readonly property: string;\n readonly span: RegExpSpan;\n readonly value?: string;\n}\n\n/** One inclusive code-point range inside a character class. */\nexport interface RegExpCharacterRange {\n readonly end: RegExpCharacter;\n readonly kind: \"range\";\n readonly span: RegExpSpan;\n readonly start: RegExpCharacter;\n}\n\n/** One member of a character class body. */\nexport type RegExpClassItem =\n | RegExpCharacter\n | RegExpCharacterRange\n | RegExpClassEscape\n | RegExpUnicodePropertyEscape;\n\n/** One `[...]` or `[^...]` character class. */\nexport interface RegExpCharacterClass {\n readonly items: readonly RegExpClassItem[];\n readonly kind: \"character-class\";\n readonly negated: boolean;\n readonly span: RegExpSpan;\n}\n\n/** One finite string alternative inside a `v`-mode `\\q{...}` operand. */\nexport interface RegExpClassStringDisjunction {\n readonly kind: \"class-strings\";\n readonly span: RegExpSpan;\n readonly strings: readonly (readonly RegExpCharacter[])[];\n}\n\n/** One operand of a `v`-mode class-set expression. */\nexport type RegExpClassSetOperand =\n | RegExpCharacter\n | RegExpCharacterRange\n | RegExpClassEscape\n | RegExpClassStringDisjunction\n | RegExpUnicodeClassSet\n | RegExpUnicodePropertyEscape;\n\n/** The operation joining operands in one `v`-mode character class. */\nexport type RegExpClassSetOperation = \"intersection\" | \"subtraction\" | \"union\";\n\n/** One nested or top-level `v`-mode class-set expression. */\nexport interface RegExpUnicodeClassSet {\n readonly kind: \"class-set\";\n readonly negated: boolean;\n readonly operands: readonly RegExpClassSetOperand[];\n readonly operation: RegExpClassSetOperation;\n readonly span: RegExpSpan;\n}\n\n/** One capturing group with its one-based index and optional name. */\nexport interface RegExpCapturingGroup {\n readonly body: RegExpDisjunction;\n readonly index: number;\n readonly kind: \"capturing-group\";\n readonly name?: string;\n readonly span: RegExpSpan;\n}\n\n/** One `(?:...)` group, which holds alternatives without capturing. */\nexport interface RegExpGroup {\n readonly body: RegExpDisjunction;\n readonly kind: \"group\";\n readonly span: RegExpSpan;\n}\n\n/** One flag an inline modifier group may add or remove. */\nexport type RegExpModifierFlag = \"i\" | \"m\" | \"s\";\n\n/**\n * One `(?ims-ims:...)` group.\n *\n * The group holds alternatives like `(?:...)` and changes the flags that\n * apply inside it. `enabled` and `disabled` are disjoint and at least one\n * of them is nonempty.\n */\nexport interface RegExpModifierGroup {\n readonly body: RegExpDisjunction;\n readonly disabled: readonly RegExpModifierFlag[];\n readonly enabled: readonly RegExpModifierFlag[];\n readonly kind: \"modifier-group\";\n readonly span: RegExpSpan;\n}\n\n/** One `\\1`-style reference to a numbered capturing group. */\nexport interface RegExpBackreference {\n readonly index: number;\n readonly kind: \"backreference\";\n readonly span: RegExpSpan;\n}\n\n/**\n * One `\\k<name>` reference.\n *\n * The candidate edition permits one name on several groups when they\n * cannot both participate in a match, so a named reference resolves to\n * every group carrying the name, in ascending index order.\n */\nexport interface RegExpNamedBackreference {\n readonly indices: readonly number[];\n readonly kind: \"named-backreference\";\n readonly name: string;\n readonly span: RegExpSpan;\n}\n\n/** One pattern element that a quantifier may repeat. */\nexport type RegExpAtom =\n | RegExpBackreference\n | RegExpCapturingGroup\n | RegExpCharacter\n | RegExpCharacterClass\n | RegExpUnicodeClassSet\n | RegExpClassEscape\n | RegExpDot\n | RegExpGroup\n | RegExpModifierGroup\n | RegExpNamedBackreference\n | RegExpUnicodePropertyEscape;\n\n/** One element of an alternative, in written order. */\nexport type RegExpTerm =\n | RegExpAtom\n | RegExpEdgeAssertion\n | RegExpLookaround\n | RegExpQuantified;\n\n/** One alternative: an ordered, possibly empty term sequence. */\nexport interface RegExpAlternative {\n readonly kind: \"alternative\";\n readonly span: RegExpSpan;\n readonly terms: readonly RegExpTerm[];\n}\n\n/** Ordered alternatives whose order is the observable choice priority. */\nexport interface RegExpDisjunction {\n readonly alternatives: readonly RegExpAlternative[];\n readonly kind: \"disjunction\";\n readonly span: RegExpSpan;\n}\n\n/** One capturing group recorded in ascending index order. */\nexport interface RegExpCapture {\n readonly index: number;\n readonly name?: string;\n readonly span: RegExpSpan;\n}\n\n/**\n * One validated pattern with the metadata a later unit needs.\n *\n * `source` and `flags.text` retain the original text, so `source`,\n * `flags`, and `toString` never reconstruct text from the tree.\n */\nexport interface RegExpPattern {\n readonly body: RegExpDisjunction;\n readonly captures: readonly RegExpCapture[];\n readonly flags: RegExpFlags;\n readonly groupNames: readonly string[];\n readonly kind: \"pattern\";\n readonly source: string;\n}\n\n/** Whether a rejected construct is invalid, unadmitted, or over a limit. */\nexport type RegExpErrorKind = \"invalid\" | \"limit\" | \"unsupported\";\n\n/** Which text of a pattern one error span addresses. */\nexport type RegExpErrorSection = \"flags\" | \"pattern\";\n\n/**\n * One rejected construct located inside the pattern or flag text.\n *\n * `kind` separates the three reasons a caller must distinguish. An\n * `invalid` construct is an ECMA-262 early error, so a literal reports it\n * as a parse rejection and a dynamic pattern throws `SyntaxError`. An\n * `unsupported` construct is valid syntax that this unit does not admit,\n * and a `limit` construct exceeds an owned resource boundary.\n */\nexport interface RegExpPatternError {\n readonly kind: RegExpErrorKind;\n readonly message: string;\n readonly section: RegExpErrorSection;\n readonly span: RegExpSpan;\n}\n\n/**\n * A construct this unit parses but does not admit by default.\n *\n * The parser recognizes each construct and refuses it with a located\n * `unsupported` error unless the caller admits the point. Admitting a\n * point never changes how any other construct parses.\n */\nexport type RegExpExtensionPoint =\n | \"class-set-notation\"\n | \"modifiers\"\n | \"unicode-property-escapes\";\n\n/**\n * Capabilities a caller supplies to the pattern parser.\n *\n * The compiler core links no Unicode data, so a construct whose validity\n * depends on it is either refused or delegated here. `identifierStart`\n * and `identifierPart` classify a group-name code point outside ASCII;\n * without them such a name is refused rather than guessed.\n * `unicodeProperty` decides whether one escape names a defined property,\n * and admitting `unicode-property-escapes` without it refuses the escape\n * rather than accepting a name nothing checked.\n */\nexport interface RegExpPatternExtensions {\n readonly admitted: readonly RegExpExtensionPoint[];\n readonly identifierPart?: (codePoint: number) => boolean;\n readonly identifierStart?: (codePoint: number) => boolean;\n readonly unicodeProperty?: (escape: RegExpUnicodePropertyEscape) => boolean;\n}\n\n/**\n * Owned resource boundaries applied while parsing one pattern.\n *\n * ECMA-262 bounds none of these, so each limit is an implementation\n * boundary that reports a located `limit` error instead of exhausting a\n * host stack or overflowing a later matcher's capture representation.\n */\nexport interface RegExpPatternLimits {\n readonly capturingGroups: number;\n readonly nestingDepth: number;\n readonly quantifierBound: number;\n readonly sourceLength: number;\n}\n\n/**\n * The reviewed default limits.\n *\n * `capturingGroups` keeps a capture index inside 16 bits, `nestingDepth`\n * bounds the parser's recursion, `quantifierBound` keeps a repetition\n * count exactly representable, and `sourceLength` bounds one pattern text.\n */\nexport const defaultRegExpPatternLimits: RegExpPatternLimits = {\n capturingGroups: 0xffff,\n nestingDepth: 256,\n quantifierBound: Number.MAX_SAFE_INTEGER,\n sourceLength: 0x10_0000,\n};\n\n/** Optional components shared by every pattern parse entry point. */\nexport interface RegExpPatternOptions {\n /**\n * Whether a pattern without `u` or `v` follows the grammar of Annex B's\n * Regular Expressions Patterns section, as the edition requires of a web\n * browser host. It is on unless a caller asks for the core grammar\n * alone, which then reports every construct only Annex B admits as an\n * `unsupported` error. Under `u` or `v` the option changes nothing.\n */\n readonly annexB?: boolean;\n readonly extensions?: RegExpPatternExtensions;\n readonly limits?: RegExpPatternLimits;\n}\n\n/** One pattern text and flag text presented to the parser. */\nexport interface RegExpPatternInput extends RegExpPatternOptions {\n readonly flags: string;\n readonly source: string;\n}\n\n/**\n * The outcome of one parse.\n *\n * `pattern` is present exactly when `parsed` is true, and `errors` is\n * nonempty exactly when it is false.\n */\nexport interface RegExpPatternResult {\n readonly errors: readonly RegExpPatternError[];\n readonly parsed: boolean;\n readonly pattern?: RegExpPattern;\n}\n"],"mappings":";;AAoCA,SAAgB,kBAAkB,OAA6B;CAC7D,OAAO,MAAM,WAAW,MAAM;AAChC;;;;;;;;AAsUA,MAAa,6BAAkD;CAC7D,iBAAiB;CACjB,cAAc;CACd,iBAAiB,OAAO;CACxB,cAAc;AAChB"}
|
package/dist/source.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region src/source.d.ts
|
|
2
|
+
/** Stable diagnostic codes owned by the Oseo compiler. */
|
|
3
|
+
type DiagnosticCode = "OSEO0001" | "OSEO1001" | "OSEO2001" | "OSEO3001";
|
|
4
|
+
/** A half-open UTF-8 byte range. */
|
|
5
|
+
interface ByteRange {
|
|
6
|
+
readonly start: number;
|
|
7
|
+
readonly end: number;
|
|
8
|
+
}
|
|
9
|
+
/** A one-based Unicode scalar-value source position. */
|
|
10
|
+
interface Position {
|
|
11
|
+
readonly line: number;
|
|
12
|
+
readonly column: number;
|
|
13
|
+
}
|
|
14
|
+
/** A half-open source range with optional retained module identity. */
|
|
15
|
+
interface SourceRange {
|
|
16
|
+
readonly start: Position;
|
|
17
|
+
readonly end: Position;
|
|
18
|
+
readonly sourceId?: string;
|
|
19
|
+
}
|
|
20
|
+
/** A source-located error independent of a bootstrap parser or host. */
|
|
21
|
+
interface Diagnostic {
|
|
22
|
+
readonly code: DiagnosticCode;
|
|
23
|
+
readonly sourceId: string;
|
|
24
|
+
readonly byteRange: ByteRange;
|
|
25
|
+
readonly range: SourceRange;
|
|
26
|
+
readonly message: string;
|
|
27
|
+
readonly notes?: readonly string[];
|
|
28
|
+
}
|
|
29
|
+
/** Input accepted by a source frontend implementation. */
|
|
30
|
+
interface SourceInput {
|
|
31
|
+
readonly source: string;
|
|
32
|
+
readonly sourceId: string;
|
|
33
|
+
}
|
|
34
|
+
/** Render the stable first line of an Oseo diagnostic. */
|
|
35
|
+
declare function renderDiagnostic(diagnostic: Diagnostic): string;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { ByteRange, Diagnostic, DiagnosticCode, Position, SourceInput, SourceRange, renderDiagnostic };
|
|
38
|
+
//# sourceMappingURL=source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.d.ts","names":[],"sources":["../src/source.ts"],"mappings":";;KACY;;UAGK;WACN;WACA;;;UAIM;WACN;WACA;;;UAIM;WACN,OAAO;WACP,KAAK;WACL;;;UAIM;WACN,MAAM;WACN;WACA,WAAW;WACX,OAAO;WACP;WACA;;;UAIM;WACN;WACA;;;iBAIK,iBAAiB,YAAY"}
|
package/dist/source.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/source.ts
|
|
2
|
+
/** Render the stable first line of an Oseo diagnostic. */
|
|
3
|
+
function renderDiagnostic(diagnostic) {
|
|
4
|
+
const position = diagnostic.range.start;
|
|
5
|
+
return `${diagnostic.sourceId}:${position.line}:${position.column}: error[${diagnostic.code}]: ${diagnostic.message}`;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { renderDiagnostic };
|
|
10
|
+
//# sourceMappingURL=source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.js","names":[],"sources":["../src/source.ts"],"sourcesContent":["/** Stable diagnostic codes owned by the Oseo compiler. */\nexport type DiagnosticCode = \"OSEO0001\" | \"OSEO1001\" | \"OSEO2001\" | \"OSEO3001\";\n\n/** A half-open UTF-8 byte range. */\nexport interface ByteRange {\n readonly start: number;\n readonly end: number;\n}\n\n/** A one-based Unicode scalar-value source position. */\nexport interface Position {\n readonly line: number;\n readonly column: number;\n}\n\n/** A half-open source range with optional retained module identity. */\nexport interface SourceRange {\n readonly start: Position;\n readonly end: Position;\n readonly sourceId?: string;\n}\n\n/** A source-located error independent of a bootstrap parser or host. */\nexport interface Diagnostic {\n readonly code: DiagnosticCode;\n readonly sourceId: string;\n readonly byteRange: ByteRange;\n readonly range: SourceRange;\n readonly message: string;\n readonly notes?: readonly string[];\n}\n\n/** Input accepted by a source frontend implementation. */\nexport interface SourceInput {\n readonly source: string;\n readonly sourceId: string;\n}\n\n/** Render the stable first line of an Oseo diagnostic. */\nexport function renderDiagnostic(diagnostic: Diagnostic): string {\n const position = diagnostic.range.start;\n return (\n `${diagnostic.sourceId}:${position.line}:${position.column}: ` +\n `error[${diagnostic.code}]: ${diagnostic.message}`\n );\n}\n"],"mappings":";;AAuCA,SAAgB,iBAAiB,YAAgC;CAC/D,MAAM,WAAW,WAAW,MAAM;CAClC,OACE,GAAG,WAAW,SAAS,GAAG,SAAS,KAAK,GAAG,SAAS,OAAO,UAClD,WAAW,KAAK,KAAK,WAAW;AAE7C"}
|