Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: give token types and etc to plugins #870

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
58 changes: 49 additions & 9 deletions acorn/src/index.js
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