File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ public final class IncrementalParseTransition {
8282 guard let furthestOffset,
8383 furthestOffset > offset else { return }
8484
85- self . lookaheadBytes [ node. id] = furthestOffset - offset
85+ self . lookaheadBytes [ node. id] = max ( furthestOffset - offset, node . byteLength )
8686 }
8787
8888 public func isValidTransition( ) -> Bool {
@@ -188,7 +188,7 @@ public struct IncrementalParseLookup {
188188
189189 let nodeAffectRange = ByteSourceRange (
190190 offset: node. position. utf8Offset,
191- length: max ( lookaheadRange, node . byteSize )
191+ length: lookaheadRange
192192 )
193193
194194 for edit in edits. edits {
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ extension Parser {
4040 self . currentToken = currentToken
4141 self . parseTransition = parseTransition
4242 self . currentOffset = lexemes. getOffsetToStart ( self . currentToken)
43- self . parseTransition? . furtheestOffset = lexemes. getOffsetToStart ( lexemes. peek ( ) ) + lexemes. peek ( ) . byteLength
43+ self . parseTransition? . furthestOffset = lexemes. getOffsetToStart ( lexemes. peek ( ) ) + lexemes. peek ( ) . byteLength
4444 }
4545
4646 fileprivate init ( cloning other: Parser ) {
@@ -98,7 +98,7 @@ extension Parser.Lookahead {
9898 mutating func consumeAnyToken( ) {
9999 tokensConsumed += 1
100100 self . currentToken = self . lexemes. advance ( )
101- self . parseTransition? . furtheestOffset = lexemes. getOffsetToStart ( lexemes. peek ( ) ) + lexemes. peek ( ) . byteLength
101+ self . parseTransition? . furthestOffset = lexemes. getOffsetToStart ( lexemes. peek ( ) ) + lexemes. peek ( ) . byteLength
102102 }
103103
104104 mutating func consumeAnyToken( remapping: RawTokenKind ) {
You can’t perform that action at this time.
0 commit comments