Skip to content

Commit 01ab443

Browse files
committed
Fix countsame when match extends to last byte
1 parent 593153b commit 01ab443

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lexer.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ function countsame(bytes::DenseVector{UInt8}, pos::I, char::Char; limit::I = len
910910
for p in pos:limit
911911
bytes[p] != uchar && return p - pos
912912
end
913-
limit + 0x1
913+
limit - pos + 0x1
914914
end
915915

916916
function nextchar(bytes::DenseVector{UInt8}, pos::I, char::UInt8; limit::I = length(bytes) % I)::I where {I <: Integer}

0 commit comments

Comments
 (0)