crystal-lang / crystal

The Crystal Programming Language
https://crystal-lang.org
Apache License 2.0
19.26k stars 1.61k forks source link

Loc pragma directly after `def` makes parser skip token #14585

Open BlobCodes opened 2 months ago

BlobCodes commented 2 months ago

Bug Report

The following code compiles because the token "this_is_ignored" is skipped by the parser:

def#<loc:push>this_is_ignored test(a)
end

test(1)

$ crystal -v
Crystal 1.12.1 [4cea10199] (2024-04-11)

LLVM: 15.0.7
Default target: x86_64-unknown-linux-gnu