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 {
82
82
guard let furthestOffset,
83
83
furthestOffset > offset else { return }
84
84
85
- self . lookaheadBytes [ node. id] = furthestOffset - offset
85
+ self . lookaheadBytes [ node. id] = max ( furthestOffset - offset, node . byteLength )
86
86
}
87
87
88
88
public func isValidTransition( ) -> Bool {
@@ -188,7 +188,7 @@ public struct IncrementalParseLookup {
188
188
189
189
let nodeAffectRange = ByteSourceRange (
190
190
offset: node. position. utf8Offset,
191
- length: max ( lookaheadRange, node . byteSize )
191
+ length: lookaheadRange
192
192
)
193
193
194
194
for edit in edits. edits {
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ extension Parser {
40
40
self . currentToken = currentToken
41
41
self . parseTransition = parseTransition
42
42
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
44
44
}
45
45
46
46
fileprivate init ( cloning other: Parser ) {
@@ -98,7 +98,7 @@ extension Parser.Lookahead {
98
98
mutating func consumeAnyToken( ) {
99
99
tokensConsumed += 1
100
100
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
102
102
}
103
103
104
104
mutating func consumeAnyToken( remapping: RawTokenKind ) {
You can’t perform that action at this time.
0 commit comments