Skip to content

Commit

Permalink
fix(exports): export the Acorn parser we use
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Oct 29, 2019
1 parent 8915dc3 commit 1cb5497
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { tokTypes: tt, TokenType } = require('acorn');
const { tokTypes: tt, TokenType, Parser: AcornParser } = require('acorn');

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

readToken(code) {
getTokenFromCode(code) {
if (code === tilde) {
return this.readToken_tilde();
}
return super.readToken(code);
return super.getTokenFromCode(code);
}

parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow) {
Expand Down Expand Up @@ -64,7 +64,6 @@ function plugin(options, Parser) {
arg = this.finishNode(arg, 'Literal');
args.push(arg);
}

if (eatenParenL || this.eat(tt.parenL)) {
// x ~. [i](y, z) := HandledPromise.applyMethod(base, i, [y, z])
// x ~. (y, z) := HandledPromise.applyFunction(base, [y, z]);
Expand Down Expand Up @@ -151,3 +150,5 @@ module.exports = function curryOptions(options) {
};
};
module.exports.tokTypes = tok;
module.exports.Parser = AcornParser;

0 comments on commit 1cb5497

Please sign in to comment.