mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
Python: Change all remaining occurrences of StrConst
Done using ``` git grep StrConst | xargs sed -i 's/StrConst/StringLiteral/g' ```
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import python
|
||||
|
||||
from StrConst s
|
||||
from StringLiteral s
|
||||
select s, s.getText()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import python
|
||||
|
||||
from StrConst s
|
||||
from StringLiteral s
|
||||
select s.getLocation().getStartLine(), s.getText(), s.getPrefix()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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 = ""
|
||||
)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import python
|
||||
|
||||
from StrConst s
|
||||
from StringLiteral s
|
||||
select s, s.getText()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import python
|
||||
|
||||
from StrConst s
|
||||
from StringLiteral s
|
||||
select s.getLocation().getStartLine(), s.getText(), s.getPrefix()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import python
|
||||
|
||||
from StrConst s
|
||||
from StringLiteral s
|
||||
select s.getLocation(), s.getText()
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import python
|
||||
|
||||
select any(StrConst s) as s, s.getText()
|
||||
select any(StringLiteral s) as s, s.getText()
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import python
|
||||
|
||||
from StrConst s
|
||||
from StringLiteral s
|
||||
select s.getLocation(), s.getPrefix(), s.getText()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user