Closed sunxd3 closed 1 year ago
bump_glue
is a bit of an unfortunate anomaly that I wish I could remove; it only needs to exist to resolve a lexing ambiguity with signed numbers:
-2
means the literal integer -2
-2*x
means the infix call (call-i -2 x)
-2^x
means (call-pre - (call-i 2 ^ x))
due to precedence (See #julialang/julia/18851)Anyway, so it seems the easiest way forward here is to just remove the num_tokens
parameter entirely, as we only ever use bump_glue
with num_tokens == 2
.
That sounds reasonable to me. PR #338
MWE:
If I understand correctly, I would expect the next_byte to be 0x00000006 as,
Maybe at https://github.com/JuliaLang/JuliaSyntax.jl/blob/fc572f95c250f802c6721f90061125b05422965e/src/parse_stream.jl#L738 should be
and maybe bound checking?
This effects
build_tree
as https://github.com/JuliaLang/JuliaSyntax.jl/blob/fc572f95c250f802c6721f90061125b05422965e/src/parse_stream.jl#L1075