renamed "isCapture" to "is_capture"

This commit is contained in:
Erik Krogh Kristensen
2020-09-04 11:52:08 +02:00
parent 35b5b660c5
commit 2dc9022aa6
9 changed files with 17 additions and 10 deletions

View File

@@ -183,7 +183,7 @@ public class RegExpExtractor {
@Override
public void visit(Group nd) {
Label lbl = extractTerm(nd, parent, idx);
if (nd.isCapture()) trapwriter.addTuple("isCapture", lbl, nd.getNumber());
if (nd.isCapture()) trapwriter.addTuple("is_capture", lbl, nd.getNumber());
if (nd.isNamed()) trapwriter.addTuple("isNamedCapture", lbl, nd.getName());
visit(nd.getOperand(), lbl, 0);
}

View File

@@ -1091,7 +1091,7 @@ regexpterm(#20383,13,#20381,0,"(need?le)")
#20384=@"loc,{#10000},14,3,14,11"
locations_default(#20384,#10000,14,3,14,11)
hasLocation(#20383,#20384)
isCapture(#20383,1)
is_capture(#20383,1)
#20385=*
regexpterm(#20385,1,#20383,0,"need?le")
#20386=@"loc,{#10000},14,4,14,10"

View File

@@ -1240,7 +1240,7 @@ regexpterm(#20415,13,#20414,0,"(abc)")
#20416=@"loc,{#10000},22,2,22,6"
locations_default(#20416,#10000,22,2,22,6)
hasLocation(#20415,#20416)
isCapture(#20415,1)
is_capture(#20415,1)
#20417=*
regexpterm(#20417,14,#20415,0,"abc")
#20418=@"loc,{#10000},22,3,22,5"
@@ -1899,7 +1899,7 @@ regexpterm(#20610,13,#20596,4,"((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)")
regexpterm(#20610,13,#20596,4,"((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)")
#20611=@"loc,{#10000},44,14,44,51"
locations_default(#20611,#10000,44,14,44,51)
hasLocation(#20610,#20611)
hasLocation(#20610,#20611)
is_capture(#20610,1)
#20612=*
regexpterm(#20612,8,#20610,0,"(?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?")
@@ -1930,7 +1930,7 @@ regexpterm(#20622,13,#20620,0,"([^<]+)")
regexpterm(#20622,13,#20620,0,"([^<]+)")
#20623=@"loc,{#10000},44,21,44,27"
locations_default(#20623,#10000,44,21,44,27)
hasLocation(#20622,#20623)
hasLocation(#20622,#20623)
is_capture(#20622,2)
#20624=*
regexpterm(#20624,9,#20622,0,"[^<]+")

View File

@@ -140,7 +140,7 @@ regexpterm(#20047,13,#20043,1,"(?<ws>\s+)")
#20048=@"loc,{#10000},1,3,1,12"
locations_default(#20048,#10000,1,3,1,12)
hasLocation(#20047,#20048)
isCapture(#20047,1)
is_capture(#20047,1)
isNamedCapture(#20047,"ws")
#20049=*
regexpterm(#20049,9,#20047,0,"\s+")

View File

@@ -240,3 +240,8 @@ deprecated predicate rangeQuantifierLowerBound(RegExpRange id, int lo) { range_q
* Use `RegExpRange#getUpperBound() instead.
*/
deprecated predicate rangeQuantifierUpperBound(RegExpRange id, int hi) { range_quantifier_upper_bound(id, hi) }
/**
* Alias for the predicate `is_capture` defined in the .dbscheme.
* Use `RegExpGroup#isCapture()` instead.
*/
deprecated predicate isCapture(RegExpGroup id, int number) { is_capture(id, number) }

View File

@@ -565,7 +565,7 @@ class RegExpDot extends RegExpTerm, @regexp_dot {
*/
class RegExpGroup extends RegExpTerm, @regexp_group {
/** Holds if this is a capture group. */
predicate isCapture() { isCapture(this, _) }
predicate isCapture() { is_capture(this, _) }
/**
* Gets the index of this capture group within the enclosing regular
@@ -576,7 +576,7 @@ class RegExpGroup extends RegExpTerm, @regexp_group {
* has index 2, and the group `(?:b)` has no index, since it is
* not a capture group.
*/
int getNumber() { isCapture(this, result) }
int getNumber() { is_capture(this, result) }
/** Holds if this is a named capture group. */
predicate isNamed() { isNamedCapture(this, _) }

View File

@@ -880,7 +880,7 @@ regexp_parse_errors (unique int id: @regexp_parse_error,
is_greedy (int id: @regexp_quantifier ref);
range_quantifier_lower_bound (unique int id: @regexp_range ref, int lo: int ref);
range_quantifier_upper_bound (unique int id: @regexp_range ref, int hi: int ref);
isCapture (unique int id: @regexp_group ref, int number: int ref);
is_capture (unique int id: @regexp_group ref, int number: int ref);
isNamedCapture (unique int id: @regexp_group ref, string name: string ref);
isInverted (int id: @regexp_char_class ref);
regexpConstValue (unique int id: @regexp_constant ref, varchar(1) value: string ref);

View File

@@ -20240,7 +20240,7 @@
</dependencies>
</relation>
<relation>
<name>isCapture</name>
<name>is_capture</name>
<cardinality>1280</cardinality>
<columnsizes>
<e>

View File

@@ -70,3 +70,5 @@ range_quantifier_lower_bound.rel: reorder rangeQuantifierLowerBound.rel(int id,
rangeQuantifierLowerBound.rel: delete
range_quantifier_upper_bound.rel: reorder rangeQuantifierUpperBound.rel(int id, int hi) id hi
rangeQuantifierUpperBound.rel: delete
is_capture.rel: reorder isCapture.rel(int id, int number) id number
isCapture.rel: delete