@ohm-js/wasm 0.6.15 → 0.6.16
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/src/miniohm.d.ts +5 -5
- package/dist/src/miniohm.js +3 -5
- package/package.json +1 -1
package/dist/src/miniohm.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export declare class WasmGrammar {
|
|
|
38
38
|
private _fillInputBuffer;
|
|
39
39
|
getRightmostFailurePosition(): number;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
interface MatchContext {
|
|
42
42
|
ruleNames: string[];
|
|
43
43
|
view: DataView;
|
|
44
44
|
input: string;
|
|
@@ -203,16 +203,16 @@ export declare class MatchResult {
|
|
|
203
203
|
toString(): string;
|
|
204
204
|
use<T>(cb: (r: MatchResult) => T): T;
|
|
205
205
|
}
|
|
206
|
-
declare class SucceededMatchResult extends MatchResult {
|
|
206
|
+
export declare class SucceededMatchResult extends MatchResult {
|
|
207
207
|
_cst: CstNode;
|
|
208
208
|
constructor(grammar: WasmGrammar, startExpr: string, ctx: MatchContext, succeeded: boolean);
|
|
209
209
|
}
|
|
210
|
-
declare class FailedMatchResult extends MatchResult {
|
|
210
|
+
export declare class FailedMatchResult extends MatchResult {
|
|
211
211
|
constructor(grammar: WasmGrammar, startExpr: string, ctx: MatchContext, succeeded: boolean, rightmostFailurePosition: number, optRecordedFailures?: any);
|
|
212
212
|
_rightmostFailurePosition: number;
|
|
213
213
|
_rightmostFailures: any;
|
|
214
|
-
shortMessage
|
|
215
|
-
message
|
|
214
|
+
shortMessage: string;
|
|
215
|
+
message: string;
|
|
216
216
|
getRightmostFailurePosition(): number;
|
|
217
217
|
getRightmostFailures(): any;
|
|
218
218
|
getExpectedText(): string;
|
package/dist/src/miniohm.js
CHANGED
|
@@ -573,22 +573,20 @@ function createMatchResult(grammar, startExpr, ctx, succeeded) {
|
|
|
573
573
|
? new SucceededMatchResult(grammar, startExpr, ctx, succeeded)
|
|
574
574
|
: new FailedMatchResult(grammar, startExpr, ctx, succeeded, grammar.getRightmostFailurePosition());
|
|
575
575
|
}
|
|
576
|
-
class SucceededMatchResult extends MatchResult {
|
|
576
|
+
export class SucceededMatchResult extends MatchResult {
|
|
577
577
|
_cst;
|
|
578
578
|
constructor(grammar, startExpr, ctx, succeeded) {
|
|
579
579
|
super(grammar, startExpr, ctx, succeeded);
|
|
580
580
|
this._cst = grammar.getCstRoot();
|
|
581
581
|
}
|
|
582
582
|
}
|
|
583
|
-
class FailedMatchResult extends MatchResult {
|
|
583
|
+
export class FailedMatchResult extends MatchResult {
|
|
584
584
|
constructor(grammar, startExpr, ctx, succeeded, rightmostFailurePosition, optRecordedFailures) {
|
|
585
585
|
super(grammar, startExpr, ctx, succeeded);
|
|
586
586
|
this._rightmostFailurePosition = rightmostFailurePosition;
|
|
587
587
|
this._rightmostFailures = optRecordedFailures;
|
|
588
588
|
// TODO: Define these as lazy properties, like in the JS implementation.
|
|
589
|
-
|
|
590
|
-
this.shortMessage = this.message = `Match failed at pos ${rightmostFailurePosition}`;
|
|
591
|
-
}
|
|
589
|
+
this.shortMessage = this.message = `Match failed at pos ${rightmostFailurePosition}`;
|
|
592
590
|
}
|
|
593
591
|
_rightmostFailurePosition;
|
|
594
592
|
_rightmostFailures;
|