Skip to content

Commit

Permalink
fix counting lineno in multi-line strings
Browse files Browse the repository at this point in the history
Signed-off-by: George Lemon <[email protected]>
  • Loading branch information
georgelemon committed Feb 23, 2024
1 parent 0bbe373 commit 9abc682
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/toktok/lexer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ macro registerTokens*(settings: static Settings, tokens: untyped) =
break
of NewLines:
if lex.multiLineStr:
# add lex.token, "\n"
inc lex.lineNumber
inc lex.bufpos
else:
lex.setError("EOL reached before end of string")
Expand All @@ -788,8 +788,8 @@ macro registerTokens*(settings: static Settings, tokens: untyped) =
else:
add lex.token, lex.buf[lex.bufpos]
inc lex.bufpos
if lex.multiLineStr:
lex.lineNumber = lineno
# if lex.multiLineStr:
# lex.lineNumber = lineno

if customHandlers.len > 0:
result.add customHandlers
Expand Down

0 comments on commit 9abc682

Please sign in to comment.