Skip to content

Commit 8061259

Browse files
Fix a bug
1 parent bdf5116 commit 8061259

File tree

1 file changed

+4
-5
lines changed
  • core/common/src/internal/format/parser

1 file changed

+4
-5
lines changed

core/common/src/internal/format/parser/Parser.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,10 @@ internal fun <T> List<ParserStructure<T>>.concat(): ParserStructure<T> {
121121
other.followedBy
122122
}
123123

124-
return if (currentNumberSpan == null) {
125-
newOperations.addAll(unconditionalModifications)
126-
ParserStructure(newOperations, mergedTails)
127-
} else if (mergedTails.none { it.operations.firstOrNull() is NumberSpanParserOperation }) {
128-
newOperations.add(NumberSpanParserOperation(currentNumberSpan))
124+
return if (mergedTails.none { it.operations.firstOrNull() is NumberSpanParserOperation }) {
125+
if (currentNumberSpan != null) {
126+
newOperations.add(NumberSpanParserOperation(currentNumberSpan))
127+
}
129128
newOperations.addAll(unconditionalModifications)
130129
ParserStructure(newOperations, mergedTails)
131130
} else {

0 commit comments

Comments
 (0)