Skip to content

Commit 45a9d5b

Browse files
committed
Java: QLDoc.
1 parent 80cb386 commit 45a9d5b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

java/ql/lib/semmle/code/java/regex/regex.qll

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,13 +472,23 @@ abstract class RegexString extends StringLiteral {
472472
)
473473
}
474474

475+
/**
476+
* Holds if a parse mode starts between `start` and `end`.
477+
*/
475478
private predicate flagGroupStart(int start, int end) {
476479
this.isGroupStart(start) and
477480
this.getChar(start + 1) = "?" and
478481
this.getChar(start + 2) in ["i", "m", "s", "u", "x", "U"] and
479482
end = start + 2
480483
}
481484

485+
/**
486+
* Holds if a parse mode group is between `start` and `end`, and includes the
487+
* mode flag `c`. For example the following span, with mode flag `i`:
488+
* ```
489+
* (?i)
490+
* ```
491+
*/
482492
private predicate flagGroup(int start, int end, string c) {
483493
exists(int inStart, int inEnd |
484494
this.flagGroupStart(start, inStart) and

0 commit comments

Comments
 (0)