Skip to content

Commit

Permalink
fix parse error metadata when lexer return eof #416
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Dec 11, 2024
1 parent 98b1e5c commit ad10645
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 37 deletions.
19 changes: 9 additions & 10 deletions dist/lips.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 9 additions & 10 deletions dist/lips.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/lips.esm.min.js

Large diffs are not rendered by default.

19 changes: 9 additions & 10 deletions dist/lips.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/lips.min.js

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions src/lips.js
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,6 @@ class Parser {
read_only(this, '_refs', [], { hidden: true });
read_only(this, '_state', {
parentheses: 0,
last_token: null,
fold_case: false
}, { hidden: true });
}
Expand Down Expand Up @@ -1534,7 +1533,7 @@ class Parser {
async peek() {
let token;
while (true) {
this._state.last_token = token = this.__lexer__.peek(true);
token = this.__lexer__.peek(true);
if (token === eof) {
return eof;
}
Expand Down Expand Up @@ -1694,7 +1693,7 @@ class Parser {
}
_agument_exception(e) {
if (this._meta) {
const { col, offset, line } = this._state.last_token;
const { col, offset, line } = this.__lexer__.__token__;
read_only(e, '__col__', col);
read_only(e, '__offset__', offset);
read_only(e, '__line__', line);
Expand Down

0 comments on commit ad10645

Please sign in to comment.