| 246 | } |
| 247 | |
| 248 | private static @Nullable String parseVar(@NotNull StringBuilder sb, @NotNull String str, |
| 249 | @NotNull OutInt fromIndex) { |
| 250 | var quoteLeft = str.indexOf('{', fromIndex.value); |
| 251 | if (quoteLeft < 0) { |
| 252 | sb.append(str, fromIndex.value, str.length()); |
| 253 | return null; |
| 254 | } |
| 255 | var quoteRight = str.indexOf('}', quoteLeft + 1); |
| 256 | if (quoteRight < 0) { |
| 257 | sb.append(str, fromIndex.value, str.length()); |
| 258 | return null; |
| 259 | } |
| 260 | sb.append(str, fromIndex.value, quoteLeft); |
| 261 | fromIndex.value = quoteRight + 1; |
| 262 | return str.substring(quoteLeft + 1, quoteRight); |
| 263 | } |
| 264 | } |