Skip to content

Commit

Permalink
add a comment for the loop
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic committed Oct 16, 2024
1 parent 63d3b4d commit bcee538
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rules/no-missing-label-refs.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ function findMissingReferences(node, nodeText) {
const labelPattern = /\[(?<left>[^\]]*)\](?:\[(?<right>[^\]]*)\])?/dgu;
let match;

/*
* This loop searches the text inside the node for sequences that
* look like label references and reports an error for each one found.
*/
while ((match = labelPattern.exec(nodeText))) {
// skip illegal shorthand tail -- handled by no-invalid-label-refs
if (illegalShorthandTailPattern.test(match[0])) {
Expand Down

0 comments on commit bcee538

Please sign in to comment.