Skip to content

Commit 95bcea2

Browse files
Jantherfvictorio
andcommitted
Update src/tokens.ts
Co-authored-by: Franco Victorio <victorio.franco@gmail.com>
1 parent 7f1b564 commit 95bcea2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tokens.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ function range(token: AntlrToken): [number, number] {
4646
}
4747

4848
function loc(token: AntlrToken): Location {
49-
const textInLines = token.text?.split(/\r?\n/) ?? ['']
49+
const tokenText = token.text ?? ''
50+
const textInLines = tokenText.split(/\r?\n/)
5051
const numberOfNewLines = textInLines.length - 1
5152
return {
5253
start: { line: token.line, column: token.column },

0 commit comments

Comments
 (0)