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

@@ -9,7 +9,7 @@ import python
predicate hasattr(CallNode c, ControlFlowNode obj, string attr) {
c.getFunction().getNode().(Name).getId() = "hasattr" and
c.getArg(0) = obj and
c.getArg(1).getNode().(StrConst).getText() = attr
c.getArg(1).getNode().(StringLiteral).getText() = attr
}
/** Holds if `c` is a call to `isinstance(use, cls)`. */

View File

@@ -691,7 +691,7 @@ module PointsToInternal {
sub.getObject() = sys_modules_flow and
pointsTo(sys_modules_flow, _, ObjectInternal::sysModules(), _) and
sub.getIndex() = n and
n.getNode().(StrConst).getText() = name and
n.getNode().(StringLiteral).getText() = name and
sub.(DefinitionNode).getValue() = mod and
pointsTo(mod, _, m, _)
)

View File

@@ -253,7 +253,7 @@ predicate executes_in_runtime_context(Function f) {
}
private predicate maybe_main(Module m) {
exists(If i, Compare cmp, Name name, StrConst main | m.getAStmt() = i and i.getTest() = cmp |
exists(If i, Compare cmp, Name name, StringLiteral main | m.getAStmt() = i and i.getTest() = cmp |
cmp.compares(name, any(Eq eq), main) and
name.getId() = "__name__" and
main.getText() = "__main__"