Skip to content

Commit

Permalink
fix(parser): dedupe some code
Browse files Browse the repository at this point in the history
  • Loading branch information
KFlash committed Jun 25, 2019
1 parent 82d9407 commit 16c95b1
Show file tree
Hide file tree
Showing 3 changed files with 257 additions and 323 deletions.
2 changes: 1 addition & 1 deletion src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export interface ParserState {
startIndex: number;
startColumn: number;
startLine: number;
columnPos: number;
colPos: number;
linePos: number;
end: number;
token: Token;
Expand Down
2 changes: 1 addition & 1 deletion src/lexer/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export function scanSingleToken(parser: ParserState, context: Context, state: Le

while (parser.index < parser.end) {
parser.tokenIndex = parser.index;
parser.columnPos = parser.column;
parser.colPos = parser.column;
parser.linePos = parser.line;

const first = parser.nextCP;
Expand Down
Loading

0 comments on commit 16c95b1

Please sign in to comment.