File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
fluent.syntax/src/main/kotlin/org/projectfluent/syntax/processor Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,6 @@ class Processor {
98
98
}
99
99
100
100
var startIndex = 0
101
- var endIndex = 0
102
101
for (i in element.value.indices) {
103
102
when (val char = element.value[i]) {
104
103
' {' , ' }' -> {
@@ -109,7 +108,6 @@ class Processor {
109
108
val expr = StringLiteral (char.toString())
110
109
yield (Placeable (expr))
111
110
startIndex = i + 1
112
- endIndex = i + 1
113
111
}
114
112
' [' , ' *' , ' .' -> {
115
113
if (i > 0 && element.value[i - 1 ] == ' \n ' ) {
@@ -119,17 +117,13 @@ class Processor {
119
117
yield (Placeable (expr))
120
118
startIndex = i + 1
121
119
}
122
- endIndex = i + 1
123
- }
124
- else -> {
125
- endIndex = i + 1
126
120
}
127
121
}
128
122
}
129
123
130
124
// Yield the remaining text.
131
- if (endIndex > startIndex) {
132
- val text = element.value.substring(startIndex, endIndex )
125
+ if (element.value.lastIndex > startIndex) {
126
+ val text = element.value.substring(startIndex)
133
127
yield (TextElement (text))
134
128
}
135
129
You can’t perform that action at this time.
0 commit comments