-
-
Notifications
You must be signed in to change notification settings - Fork 38
Closed
Description
MWE:
julia> ps = ParseStream("a + b - c * d"); peek(ps);
julia> bump_glue(ps, K"Identifier", EMPTY_FLAGS, 4)
JuliaSyntax.ParseStreamPosition(0x00000002, 0x00000000)
julia> ps.tokens[end] |> dump
JuliaSyntax.SyntaxToken
head: JuliaSyntax.SyntaxHead
kind: JuliaSyntax.Kind K"Identifier"
flags: UInt16 0x0000
orig_kind: JuliaSyntax.Kind K"Identifier"
preceding_whitespace: Bool false
next_byte: UInt32 0x00000003
If I understand correctly, I would expect the next_byte to be 0x00000006 as,
julia> JuliaSyntax.peek_token(ps)
Identifier |6
Maybe at
JuliaSyntax.jl/src/parse_stream.jl
Line 738 in fc572f9
stream.lookahead[i+1].next_byte)) |
should be
stream.lookahead[i+num_tokens].next_byte))
and maybe bound checking?
This effects build_tree
as
JuliaSyntax.jl/src/parse_stream.jl
Line 1075 in fc572f9
stream.tokens[end].next_byte - 1) |
Metadata
Metadata
Assignees
Labels
No labels