* @brief Consumes a Lua identifier, applying block open/close keyword deltas; returns next index. */
| 372 | * @brief Consumes a Lua identifier, applying block open/close keyword deltas; returns next index. |
| 373 | */ |
| 374 | static int consumeLuaWord(QStringView line, int i, TokenTrack& tk, LineInfo& info) |
| 375 | { |
| 376 | int j = i; |
| 377 | while (j < line.size() && isLuaIdentChar(line[j], false)) |
| 378 | ++j; |
| 379 | |
| 380 | const QString word = line.mid(i, j - i).toString(); |
| 381 | if (luaCloseKeywords().contains(word)) { |
| 382 | if (!tk.sawCode) |
| 383 | ++info.outdentLeading; |
| 384 | |
| 385 | --info.netDelta; |
| 386 | } |
| 387 | |
| 388 | if (luaOpenKeywords().contains(word)) |
| 389 | ++info.netDelta; |
| 390 | |
| 391 | if (tk.firstWord.isEmpty()) |
| 392 | tk.firstWord = word; |
| 393 | |
| 394 | tk.lastWord = word; |
| 395 | markCode(tk, line[j - 1], true); |
| 396 | return j; |
| 397 | } |
| 398 | |
| 399 | /** |
| 400 | * @brief Consumes a JavaScript identifier and records it in the track; returns next index. |
no test coverage detected