Skip to content

Commit 7291f0b

Browse files
committed
Added comment explaining nullable DisjunctionListRxGene in capture group maps.
1 parent a7e6dd7 commit 7291f0b

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

core/src/main/kotlin/org/evomaster/core/parser/GeneRegexJavaVisitor.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,20 @@ class GeneRegexJavaVisitor : RegexJavaBaseVisitor<VisitResult>(){
4040
* Capture groups in order of appearance (1-based index -> list index 0).
4141
* Populated as the tree is walked. A backreference is only valid if it
4242
* appears after the group it references, which Java regex requires anyway.
43-
* Nullable DisjunctionListRxGene to represent unsatisfiable backreference.
43+
* The value is nullable to represent a captured group that is unsatisfiable,
44+
* for example when the group contains an empty character class like `([a&&b])`.
45+
* In that case the map holds null instead of a DisjunctionListRxGene.
46+
* @see buildDisjunctionList
4447
*/
4548
private val captureGroups = mutableListOf<DisjunctionListRxGene?>()
4649

4750
/**
4851
* Same as [captureGroups] but for named backreferences, which can be accessed
4952
* with their name or number.
50-
* Nullable DisjunctionListRxGene to represent unsatisfiable backreference.
53+
* The value is nullable to represent a captured group that is unsatisfiable,
54+
* for example when the group contains an empty character class like `([a&&b])`.
55+
* In that case the map holds null instead of a DisjunctionListRxGene.
56+
* @see buildDisjunctionList
5157
*/
5258
private val namedCaptureGroups = mutableMapOf<String, DisjunctionListRxGene?>()
5359

0 commit comments

Comments
 (0)