File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed
core/common/src/internal/format/parser Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -84,22 +84,24 @@ internal fun <T> List<ParserStructure<T>>.concat(): ParserStructure<T> {
8484 val unconditionalModifications = mutableListOf<UnconditionalModification <T >>()
8585
8686 for (op in operations) {
87- if (op is NumberSpanParserOperation ) {
88- if (currentNumberSpan != null ) {
89- currentNumberSpan.addAll(op.consumers)
90- } else {
91- currentNumberSpan = op.consumers.toMutableList()
87+ when (op) {
88+ is NumberSpanParserOperation -> {
89+ if (currentNumberSpan != null ) {
90+ currentNumberSpan.addAll(op.consumers)
91+ } else {
92+ currentNumberSpan = op.consumers.toMutableList()
93+ }
9294 }
93- } else if (op is UnconditionalModification ) {
94- unconditionalModifications.add(op)
95- } else {
96- if (currentNumberSpan != null ) {
97- newOperations.add(NumberSpanParserOperation (currentNumberSpan))
98- currentNumberSpan = null
99- newOperations.addAll(unconditionalModifications)
100- unconditionalModifications.clear()
95+ is UnconditionalModification -> unconditionalModifications.add(op)
96+ else -> {
97+ if (currentNumberSpan != null ) {
98+ newOperations.add(NumberSpanParserOperation (currentNumberSpan))
99+ currentNumberSpan = null
100+ newOperations.addAll(unconditionalModifications)
101+ unconditionalModifications.clear()
102+ }
103+ newOperations.add(op)
101104 }
102- newOperations.add(op)
103105 }
104106 }
105107
You can’t perform that action at this time.
0 commit comments