Skip to content

Commit

Permalink
Move tokenizer creation to separated method
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed May 7, 2017
1 parent 200d478 commit d06be72
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/parser.es6
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ export default class Parser {
this.spaces = '';
this.semicolon = false;

this.tokenizer = tokenizer(this.input);

this.createTokenizer();
this.root.source = { input, start: { line: 1, column: 1 } };
}

createTokenizer() {
this.tokenizer = tokenizer(this.input);
}

parse() {
let token;
while ( !this.tokenizer.endOfFile() ) {
Expand Down

0 comments on commit d06be72

Please sign in to comment.