Skip to content

Commit abbc929

Browse files
authored
Merge pull request #2891 from tausbn/python-special-operations
Python: Add AST support for special operations.
2 parents 382e4bc + 913db46 commit abbc929

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

python/ql/src/semmle/python/AstGenerated.qll

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* This library file is auto-generated by 'semmle/query_gen.py'.
3+
* WARNING: Any modifications to this file will be lost.
4+
* Relations can be changed by modifying master.py.
5+
*/
16
import python
27

38
library class Add_ extends @py_Add, Operator {
@@ -1781,6 +1786,37 @@ library class Slice_ extends @py_Slice, Expr {
17811786

17821787
}
17831788

1789+
library class SpecialOperation_ extends @py_SpecialOperation, Expr {
1790+
1791+
1792+
/** Gets the name of this special operation. */
1793+
string getName() {
1794+
py_strs(result, this, 2)
1795+
}
1796+
1797+
1798+
/** Gets the arguments of this special operation. */
1799+
ExprList getArguments() {
1800+
py_expr_lists(result, this, 3)
1801+
}
1802+
1803+
1804+
/** Gets the nth argument of this special operation. */
1805+
Expr getArgument(int index) {
1806+
result = this.getArguments().getItem(index)
1807+
}
1808+
1809+
/** Gets an argument of this special operation. */
1810+
Expr getAnArgument() {
1811+
result = this.getArguments().getAnItem()
1812+
}
1813+
1814+
override string toString() {
1815+
result = "SpecialOperation"
1816+
}
1817+
1818+
}
1819+
17841820
library class Starred_ extends @py_Starred, Expr {
17851821

17861822

0 commit comments

Comments
 (0)