Skip to content

Commit defbee2

Browse files
committed
renamed "rangeQuantifierLowerBound" to "range_quantifier_lower_bound"
1 parent 0962af5 commit defbee2

File tree

7 files changed

+20
-13
lines changed

7 files changed

+20
-13
lines changed

javascript/extractor/src/com/semmle/js/extractor/RegExpExtractor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public void visit(Range nd) {
243243
if (nd.isGreedy()) trapwriter.addTuple("is_greedy", lbl);
244244

245245
long lo = nd.getLowerBound();
246-
if (inRange(lo)) trapwriter.addTuple("rangeQuantifierLowerBound", lbl, lo);
246+
if (inRange(lo)) trapwriter.addTuple("range_quantifier_lower_bound", lbl, lo);
247247

248248
if (nd.hasUpperBound()) {
249249
long hi = nd.getUpperBound();

javascript/extractor/tests/exprs/output/trap/regexp.js.trap

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ regexpterm(#20375,11,#20374,0,"a{1}")
10871087
locations_default(#20376,#10000,15,2,15,5)
10881088
hasLocation(#20375,#20376)
10891089
is_greedy(#20375)
1090-
rangeQuantifierLowerBound(#20375,1)
1090+
range_quantifier_lower_bound(#20375,1)
10911091
rangeQuantifierUpperBound(#20375,1)
10921092
#20377=*
10931093
regexpterm(#20377,14,#20375,0,"a")
@@ -1111,7 +1111,7 @@ regexpterm(#20381,11,#20380,0,"a{1,}")
11111111
locations_default(#20382,#10000,16,2,16,6)
11121112
hasLocation(#20381,#20382)
11131113
is_greedy(#20381)
1114-
rangeQuantifierLowerBound(#20381,1)
1114+
range_quantifier_lower_bound(#20381,1)
11151115
#20383=*
11161116
regexpterm(#20383,14,#20381,0,"a")
11171117
#20384=@"loc,{#10000},16,2,16,2"
@@ -1134,7 +1134,7 @@ regexpterm(#20387,11,#20386,0,"a{1,2}")
11341134
locations_default(#20388,#10000,17,2,17,7)
11351135
hasLocation(#20387,#20388)
11361136
is_greedy(#20387)
1137-
rangeQuantifierLowerBound(#20387,1)
1137+
range_quantifier_lower_bound(#20387,1)
11381138
rangeQuantifierUpperBound(#20387,2)
11391139
#20389=*
11401140
regexpterm(#20389,14,#20387,0,"a")
@@ -1157,7 +1157,7 @@ regexpterm(#20393,11,#20392,0,"a{1}?")
11571157
#20394=@"loc,{#10000},18,2,18,6"
11581158
locations_default(#20394,#10000,18,2,18,6)
11591159
hasLocation(#20393,#20394)
1160-
rangeQuantifierLowerBound(#20393,1)
1160+
range_quantifier_lower_bound(#20393,1)
11611161
rangeQuantifierUpperBound(#20393,1)
11621162
#20395=*
11631163
regexpterm(#20395,14,#20393,0,"a")
@@ -1180,7 +1180,7 @@ regexpterm(#20399,11,#20398,0,"a{1,}?")
11801180
#20400=@"loc,{#10000},19,2,19,7"
11811181
locations_default(#20400,#10000,19,2,19,7)
11821182
hasLocation(#20399,#20400)
1183-
rangeQuantifierLowerBound(#20399,1)
1183+
range_quantifier_lower_bound(#20399,1)
11841184
#20401=*
11851185
regexpterm(#20401,14,#20399,0,"a")
11861186
#20402=@"loc,{#10000},19,2,19,2"
@@ -1202,7 +1202,7 @@ regexpterm(#20405,11,#20404,0,"a{1,2}?")
12021202
#20406=@"loc,{#10000},20,2,20,8"
12031203
locations_default(#20406,#10000,20,2,20,8)
12041204
hasLocation(#20405,#20406)
1205-
rangeQuantifierLowerBound(#20405,1)
1205+
range_quantifier_lower_bound(#20405,1)
12061206
rangeQuantifierUpperBound(#20405,2)
12071207
#20407=*
12081208
regexpterm(#20407,14,#20405,0,"a")
@@ -1671,7 +1671,7 @@ regexpterm(#20542,11,#20541,0,"a{")
16711671
locations_default(#20543,#10000,37,2,37,3)
16721672
hasLocation(#20542,#20543)
16731673
is_greedy(#20542)
1674-
rangeQuantifierLowerBound(#20542,0)
1674+
range_quantifier_lower_bound(#20542,0)
16751675
rangeQuantifierUpperBound(#20542,0)
16761676
#20544=*
16771677
regexpterm(#20544,14,#20542,0,"a")
@@ -1710,7 +1710,7 @@ regexpterm(#20554,11,#20552,0,"a{")
17101710
locations_default(#20555,#10000,38,2,38,3)
17111711
hasLocation(#20554,#20555)
17121712
is_greedy(#20554)
1713-
rangeQuantifierLowerBound(#20554,0)
1713+
range_quantifier_lower_bound(#20554,0)
17141714
rangeQuantifierUpperBound(#20554,0)
17151715
#20556=*
17161716
regexpterm(#20556,14,#20554,0,"a")
@@ -1757,7 +1757,7 @@ regexpterm(#20568,11,#20567,0,"a{2")
17571757
locations_default(#20569,#10000,39,2,39,4)
17581758
hasLocation(#20568,#20569)
17591759
is_greedy(#20568)
1760-
rangeQuantifierLowerBound(#20568,2)
1760+
range_quantifier_lower_bound(#20568,2)
17611761
rangeQuantifierUpperBound(#20568,2)
17621762
#20570=*
17631763
regexpterm(#20570,14,#20568,0,"a")

javascript/ql/src/semmle/javascript/Aliases.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,3 +230,8 @@ deprecated predicate regexpParseErrors(RegExpParseError id, RegExpTerm regexp, s
230230
* Use `RegExpQuantifier#isGreedy` instead.
231231
*/
232232
deprecated predicate isGreedy(RegExpQuantifier id) { is_greedy(id) }
233+
/**
234+
* Alias for the predicate `range_quantifier_lower_bound` defined in the .dbscheme.
235+
* Use `RegExpRange#getLowerBound()` instead.
236+
*/
237+
deprecated predicate rangeQuantifierLowerBound(RegExpRange id, int lo) { range_quantifier_lower_bound(id, lo) }

javascript/ql/src/semmle/javascript/Regexp.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ class RegExpOpt extends RegExpQuantifier, @regexp_opt {
522522
*/
523523
class RegExpRange extends RegExpQuantifier, @regexp_range {
524524
/** Gets the lower bound of the range. */
525-
int getLowerBound() { rangeQuantifierLowerBound(this, result) }
525+
int getLowerBound() { range_quantifier_lower_bound(this, result) }
526526

527527
/**
528528
* Gets the upper bound of the range, if any.

javascript/ql/src/semmlecode.javascript.dbscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ regexp_parse_errors (unique int id: @regexp_parse_error,
878878
@regexp_anchor = @regexp_dollar | @regexp_caret;
879879

880880
is_greedy (int id: @regexp_quantifier ref);
881-
rangeQuantifierLowerBound (unique int id: @regexp_range ref, int lo: int ref);
881+
range_quantifier_lower_bound (unique int id: @regexp_range ref, int lo: int ref);
882882
rangeQuantifierUpperBound (unique int id: @regexp_range ref, int hi: int ref);
883883
isCapture (unique int id: @regexp_group ref, int number: int ref);
884884
isNamedCapture (unique int id: @regexp_group ref, string name: string ref);

javascript/ql/src/semmlecode.javascript.dbscheme.stats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20084,7 +20084,7 @@
2008420084
</relation>
2008520085

2008620086
<relation>
20087-
<name>rangeQuantifierLowerBound</name>
20087+
<name>range_quantifier_lower_bound</name>
2008820088
<cardinality>146</cardinality>
2008920089
<columnsizes>
2009020090
<e>

javascript/upgrades/c73fbfca57f3d593b9ff50c6aa3a886d6888efec/upgrade.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,5 @@ regexp_parse_errors.rel: reorder regexpParseErrors.rel(int id, int regexp, strin
6666
regexpParseErrors.rel: delete
6767
is_greedy.rel: reorder isGreedy.rel(int id) id
6868
isGreedy.rel: delete
69+
range_quantifier_lower_bound.rel: reorder rangeQuantifierLowerBound.rel(int id, int lo) id lo
70+
rangeQuantifierLowerBound.rel: delete

0 commit comments

Comments
 (0)