Skip to content

Expose parse to the public #2534

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

Merged
merged 2 commits into from
May 4, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
expose parse to the public
  • Loading branch information
clebert authored and Conduitry committed May 4, 2019
commit 194e99b350fb9b18b88bdb90f6539f4c0847962a
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { default as compile } from './compile/index';
export { default as parse } from './parse/index';
export { default as preprocess } from './preprocess/index';

export const VERSION = '__VERSION__';
5 changes: 5 additions & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ export interface CompileOptions {
preserveWhitespace?: boolean;
}

export interface ParserOptions {
filename?: string;
customElement?: boolean;
}

export interface Visitor {
enter: (node: Node) => void;
leave?: (node: Node) => void;
Expand Down
7 changes: 1 addition & 6 deletions src/parse/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ import fragment from './state/fragment';
import { whitespace } from '../utils/patterns';
import { reserved } from '../utils/names';
import full_char_code_at from '../utils/full_char_code_at';
import { Node, Ast } from '../interfaces';
import { Node, Ast, ParserOptions } from '../interfaces';
import error from '../utils/error';

interface ParserOptions {
filename?: string;
customElement?: boolean;
}

type ParserState = (parser: Parser) => (ParserState | void);

export class Parser {
Expand Down