Skip to content

Commit f66dcca

Browse files
committed
Python: Rename prettyExp => prettyExpr
So we're consistenly using `expr` and not leaving our the `r`.
1 parent c4f604b commit f66dcca

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import python
22
import semmle.python.dataflow.new.DataFlow
33

4-
string prettyExp(Expr e) {
4+
string prettyExpr(Expr e) {
55
not e instanceof Num and
66
not e instanceof StrConst and
77
not e instanceof Subscript and
@@ -15,17 +15,17 @@ string prettyExp(Expr e) {
1515
e.(StrConst).getPrefix() + e.(StrConst).getText() +
1616
e.(StrConst).getPrefix().regexpReplaceAll("[a-zA-Z]+", "")
1717
or
18-
result = prettyExp(e.(Subscript).getObject()) + "[" + prettyExp(e.(Subscript).getIndex()) + "]"
18+
result = prettyExpr(e.(Subscript).getObject()) + "[" + prettyExpr(e.(Subscript).getIndex()) + "]"
1919
or
2020
(
2121
if exists(e.(Call).getAnArg()) or exists(e.(Call).getANamedArg())
22-
then result = prettyExp(e.(Call).getFunc()) + "(..)"
23-
else result = prettyExp(e.(Call).getFunc()) + "()"
22+
then result = prettyExpr(e.(Call).getFunc()) + "(..)"
23+
else result = prettyExpr(e.(Call).getFunc()) + "()"
2424
)
2525
or
26-
result = prettyExp(e.(Attribute).getObject()) + "." + e.(Attribute).getName()
26+
result = prettyExpr(e.(Attribute).getObject()) + "." + e.(Attribute).getName()
2727
}
2828

2929
string prettyNode(DataFlow::Node node) {
30-
if exists(node.asExpr()) then result = prettyExp(node.asExpr()) else result = node.toString()
30+
if exists(node.asExpr()) then result = prettyExpr(node.asExpr()) else result = node.toString()
3131
}

python/ql/test/experimental/dataflow/tainttracking/TestTaintLib.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ query predicate test_taint(string arg_location, string test_res, string scope_na
4646
arg_location = arg.getLocation().toString() and
4747
test_res = test_res and
4848
scope_name = call.getScope().getName() and
49-
repr = prettyExp(arg)
49+
repr = prettyExpr(arg)
5050
)
5151
}

python/ql/test/experimental/meta/InlineTaintTest.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class InlineTaintTest extends InlineExpectationsTest {
5858
exists(DataFlow::Node sink |
5959
any(TestTaintTrackingConfiguration config).hasFlow(_, sink) and
6060
location = sink.getLocation() and
61-
element = prettyExp(sink.asExpr()) and
61+
element = prettyExpr(sink.asExpr()) and
6262
value = "" and
6363
tag = "tainted"
6464
)
@@ -84,7 +84,7 @@ query predicate untaintedArgumentToEnsureTaintedNotMarkedAsMissing(
8484
error = "ERROR, you should add `# $ MISSING: tainted` annotation" and
8585
exists(DataFlow::Node sink |
8686
sink = shouldBeTainted() and
87-
element = prettyExp(sink.asExpr()) and
87+
element = prettyExpr(sink.asExpr()) and
8888
not any(TestTaintTrackingConfiguration config).hasFlow(_, sink) and
8989
location = sink.getLocation() and
9090
not exists(FalseNegativeExpectation missingResult |

0 commit comments

Comments
 (0)