mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Merge pull request #2891 from tausbn/python-special-operations
Python: Add AST support for special operations.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
/*
|
||||
* This library file is auto-generated by 'semmle/query_gen.py'.
|
||||
* WARNING: Any modifications to this file will be lost.
|
||||
* Relations can be changed by modifying master.py.
|
||||
*/
|
||||
import python
|
||||
|
||||
library class Add_ extends @py_Add, Operator {
|
||||
@@ -1781,6 +1786,37 @@ library class Slice_ extends @py_Slice, Expr {
|
||||
|
||||
}
|
||||
|
||||
library class SpecialOperation_ extends @py_SpecialOperation, Expr {
|
||||
|
||||
|
||||
/** Gets the name of this special operation. */
|
||||
string getName() {
|
||||
py_strs(result, this, 2)
|
||||
}
|
||||
|
||||
|
||||
/** Gets the arguments of this special operation. */
|
||||
ExprList getArguments() {
|
||||
py_expr_lists(result, this, 3)
|
||||
}
|
||||
|
||||
|
||||
/** Gets the nth argument of this special operation. */
|
||||
Expr getArgument(int index) {
|
||||
result = this.getArguments().getItem(index)
|
||||
}
|
||||
|
||||
/** Gets an argument of this special operation. */
|
||||
Expr getAnArgument() {
|
||||
result = this.getArguments().getAnItem()
|
||||
}
|
||||
|
||||
override string toString() {
|
||||
result = "SpecialOperation"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
library class Starred_ extends @py_Starred, Expr {
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user