* @brief Consumes a JavaScript identifier and records it in the track; returns next index. */
| 400 | * @brief Consumes a JavaScript identifier and records it in the track; returns next index. |
| 401 | */ |
| 402 | static int consumeJsWord(QStringView line, int i, TokenTrack& tk) |
| 403 | { |
| 404 | int j = i; |
| 405 | while (j < line.size() && isJsIdentChar(line[j], false)) |
| 406 | ++j; |
| 407 | |
| 408 | if (tk.firstWord.isEmpty()) |
| 409 | tk.firstWord = line.mid(i, j - i).toString(); |
| 410 | |
| 411 | tk.lastWord = line.mid(i, j - i).toString(); |
| 412 | markCode(tk, line[j - 1], true); |
| 413 | return j; |
| 414 | } |
| 415 | |
| 416 | /** |
| 417 | * @brief Flags the line as a hanging header when its code is a brace-free JS control statement. |
no test coverage detected