Skip to content

Commit

Permalink
give token types and etc to plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea authored and marijnh committed Sep 24, 2019
1 parent 1198a58 commit 90ed904
Showing 1 changed file with 49 additions and 9 deletions.
58 changes: 49 additions & 9 deletions acorn/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,57 @@ import "./expression"
import "./location"
import "./scope"

export {Parser} from "./state"
export {defaultOptions} from "./options"
export {Position, SourceLocation, getLineInfo} from "./locutil"
export {Node} from "./node"
export {TokenType, types as tokTypes, keywords as keywordTypes} from "./tokentype"
export {TokContext, types as tokContexts} from "./tokencontext"
export {isIdentifierChar, isIdentifierStart} from "./identifier"
export {Token} from "./tokenize"
export {isNewLine, lineBreak, lineBreakG, nonASCIIwhitespace} from "./whitespace"
import {defaultOptions} from "./options"
import {Position, SourceLocation, getLineInfo} from "./locutil"
import {Node} from "./node"
import {TokenType, types as tokTypes, keywords as keywordTypes} from "./tokentype"
import {TokContext, types as tokContexts} from "./tokencontext"
import {isIdentifierChar, isIdentifierStart} from "./identifier"
import {Token} from "./tokenize"
import {isNewLine, lineBreak, lineBreakG, nonASCIIwhitespace} from "./whitespace"

export const version = "7.0.0"
export {
Parser,
defaultOptions,
Position,
SourceLocation,
getLineInfo,
Node,
TokenType,
tokTypes,
keywordTypes,
TokContext,
tokContexts,
isIdentifierChar,
isIdentifierStart,
Token,
isNewLine,
lineBreak,
lineBreakG,
nonASCIIwhitespace
}

Parser.acorn = {
version,
defaultOptions,
Position,
SourceLocation,
getLineInfo,
Node,
TokenType,
tokTypes,
keywordTypes,
TokContext,
tokContexts,
isIdentifierChar,
isIdentifierStart,
Token,
isNewLine,
lineBreak,
lineBreakG,
nonASCIIwhitespace
}

// The main exported interface (under `self.acorn` when in the
// browser) is a `parse` function that takes a code string and
Expand Down

0 comments on commit 90ed904

Please sign in to comment.