Skip to content

Commit 1cb5497

Browse files
committed
fix(exports): export the Acorn parser we use
1 parent 8915dc3 commit 1cb5497

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

index.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { tokTypes: tt, TokenType } = require('acorn');
1+
const { tokTypes: tt, TokenType, Parser: AcornParser } = require('acorn');
22

33
const tok = {
44
tildeDot: new TokenType('~.'),
@@ -21,11 +21,11 @@ function plugin(options, Parser) {
2121
return this.finishOp(tt.prefix, 1);
2222
}
2323

24-
readToken(code) {
24+
getTokenFromCode(code) {
2525
if (code === tilde) {
2626
return this.readToken_tilde();
2727
}
28-
return super.readToken(code);
28+
return super.getTokenFromCode(code);
2929
}
3030

3131
parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow) {
@@ -64,7 +64,6 @@ function plugin(options, Parser) {
6464
arg = this.finishNode(arg, 'Literal');
6565
args.push(arg);
6666
}
67-
6867
if (eatenParenL || this.eat(tt.parenL)) {
6968
// x ~. [i](y, z) := HandledPromise.applyMethod(base, i, [y, z])
7069
// x ~. (y, z) := HandledPromise.applyFunction(base, [y, z]);
@@ -151,3 +150,5 @@ module.exports = function curryOptions(options) {
151150
};
152151
};
153152
module.exports.tokTypes = tok;
153+
module.exports.Parser = AcornParser;
154+

0 commit comments

Comments
 (0)