Skip to content

Commit

Permalink
Lexer: fix names with trailing number
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanjermakov committed Apr 22, 2024
1 parent 8f2eb0f commit d28a36c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lexer/lexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ const parseConstToken =
if (ctx.code[ctx.pos] !== value[0]) continue
const actual = ctx.code.slice(ctx.pos, ctx.pos + value.length)
const trailing = ctx.code.at(ctx.pos + value.length)
if (actual === value && (!isAlpha(value[0]) || !trailing || !isAlpha(trailing))) {
if (actual === value && (!isAlpha(value[0]) || !trailing || (!isAlpha(trailing) && !isNumeric(trailing)))) {
const start = ctx.pos
ctx.pos += value.length
ctx.tokens.push(createToken(kind, value, ctx.pos, start))
Expand Down

0 comments on commit d28a36c

Please sign in to comment.