Python: Change all remaining occurrences of StrConst

Done using
```
git grep StrConst | xargs sed -i 's/StrConst/StringLiteral/g'
```
This commit is contained in:
Taus
2024-04-17 16:03:45 +00:00
parent f6487d7b13
commit 1c68c987b0
101 changed files with 211 additions and 211 deletions

View File

@@ -1,4 +1,4 @@
import python
from StrConst s
from StringLiteral s
select s, s.getText()

View File

@@ -1,4 +1,4 @@
import python
from StrConst s
from StringLiteral s
select s.getLocation().getStartLine(), s.getText(), s.getPrefix()

View File

@@ -1,5 +1,5 @@
import python
from StrConst s, int bl, int bc, int el, int ec
from StringLiteral s, int bl, int bc, int el, int ec
where s.getLocation().hasLocationInfo(_, bl, bc, el, ec)
select bl, bc, el, ec, s.getText()

View File

@@ -8,7 +8,7 @@ where
not exists(val.getConversion()) and typeconv = " "
) and
(
format = val.getFormatSpec().getValue(0).(StrConst).getText()
format = val.getFormatSpec().getValue(0).(StringLiteral).getText()
or
not exists(val.getFormatSpec()) and format = ""
)

View File

@@ -1,9 +1,9 @@
import python
string repr(AstNode a) {
not a instanceof StrConst and result = a.toString()
not a instanceof StringLiteral and result = a.toString()
or
result = "\"" + a.(StrConst).getText() + "\""
result = "\"" + a.(StringLiteral).getText() + "\""
}
from ControlFlowNode p, ControlFlowNode s, BasicBlock b, int n

View File

@@ -1,9 +1,9 @@
import python
string repr(AstNode a) {
not a instanceof StrConst and result = a.toString()
not a instanceof StringLiteral and result = a.toString()
or
result = "\"" + a.(StrConst).getText() + "\""
result = "\"" + a.(StringLiteral).getText() + "\""
}
from ControlFlowNode p, ControlFlowNode s, BasicBlock b, int n

View File

@@ -1,4 +1,4 @@
import python
from StrConst s
from StringLiteral s
select s, s.getText()

View File

@@ -1,4 +1,4 @@
import python
from StrConst s
from StringLiteral s
select s.getLocation().getStartLine(), s.getText(), s.getPrefix()

View File

@@ -27,7 +27,7 @@ module TestConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node node) {
node.(DataFlow::CfgNode).getNode().(NameNode).getId() = "SOURCE"
or
node.(DataFlow::CfgNode).getNode().getNode().(StrConst).getS() = "source"
node.(DataFlow::CfgNode).getNode().getNode().(StringLiteral).getS() = "source"
or
node.(DataFlow::CfgNode).getNode().getNode().(IntegerLiteral).getN() = "42"
or

View File

@@ -28,7 +28,7 @@ module TestConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node node) {
node.(DataFlow::CfgNode).getNode().(NameNode).getId() = "SOURCE"
or
node.(DataFlow::CfgNode).getNode().getNode().(StrConst).getS() = "source"
node.(DataFlow::CfgNode).getNode().getNode().(StringLiteral).getS() = "source"
or
node.(DataFlow::CfgNode).getNode().getNode().(IntegerLiteral).getN() = "42"
or

View File

@@ -9,7 +9,7 @@ private class SourceString extends DataFlow::Node {
string contents;
SourceString() {
this.asExpr().(StrConst).getText() = contents and
this.asExpr().(StringLiteral).getText() = contents and
this.asExpr().getParent() instanceof Assign
or
this.asExpr().(ClassExpr).getInnerScope().getName() = "SOURCE" and

View File

@@ -1,4 +1,4 @@
import python
from StrConst s
from StringLiteral s
select s.getLocation(), s.getText()

View File

@@ -1,3 +1,3 @@
import python
select any(StrConst s) as s, s.getText()
select any(StringLiteral s) as s, s.getText()

View File

@@ -6,6 +6,6 @@ class CustomEntryPoint extends API::EntryPoint {
CustomEntryPoint() { this = "CustomEntryPoint" }
override DataFlow::LocalSourceNode getASource() {
result.asExpr().(StrConst).getText() = "magic_string"
result.asExpr().(StringLiteral).getText() = "magic_string"
}
}

View File

@@ -1,4 +1,4 @@
import python
from StrConst s
from StringLiteral s
select s.getLocation(), s.getPrefix(), s.getText()

View File

@@ -1,5 +1,5 @@
import python
from StrConst s, StringPart part, int n
from StringLiteral s, StringPart part, int n
where part = s.getImplicitlyConcatenatedPart(n)
select s.getLocation().getStartLine(), s.getText(), n, part.getText()

View File

@@ -1,10 +1,10 @@
import python
class ImplicitConcat extends StrConst {
class ImplicitConcat extends StringLiteral {
ImplicitConcat() { exists(this.getAnImplicitlyConcatenatedPart()) }
}
from StrConst s, boolean isConcat
from StringLiteral s, boolean isConcat
where
s instanceof ImplicitConcat and isConcat = true
or