@@ -97,29 +97,32 @@ extension String {
97
97
98
98
case . horizontalWhitespace:
99
99
switch asciiValue {
100
- case _space, _tab: return ( next, true )
101
- default : return ( next, false )
100
+ case _space, _tab: return ( next, true )
101
+ default : return ( next, false )
102
102
}
103
103
104
104
case . verticalWhitespace, . newlineSequence:
105
105
switch asciiValue {
106
- case _lineFeed, _carriageReturn, _lineTab, _formFeed:
106
+ case _lineFeed, _carriageReturn, _lineTab, _formFeed:
107
107
// Scalar semantics: For `\v`, only advance past the CR instead of CR-LF
108
108
if isScalarSemantics && isCRLF && cc == . verticalWhitespace {
109
109
return ( utf8. index ( before: next) , true )
110
110
}
111
111
return ( next, true )
112
112
113
- default :
114
- return ( next, false )
113
+ default :
114
+ return ( next, false )
115
115
}
116
116
117
117
case . whitespace:
118
118
switch asciiValue {
119
- case _space, _tab, _lineFeed, _lineTab, _formFeed, _carriageReturn:
120
- return ( next, true )
121
- default :
122
- return ( next, false )
119
+ case _space, _tab, _lineFeed, _lineTab, _formFeed, _carriageReturn:
120
+ if isScalarSemantics && isCRLF {
121
+ return ( utf8. index ( before: next) , true )
122
+ }
123
+ return ( next, true )
124
+ default :
125
+ return ( next, false )
123
126
}
124
127
125
128
case . word:
0 commit comments