Skip to content

Commit f64f6e6

Browse files
committed
Python: Move classes for lists of AST nodes into AstExtended.qll
1 parent 97f9920 commit f64f6e6

File tree

3 files changed

+56
-56
lines changed

3 files changed

+56
-56
lines changed

python/ql/src/python.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import semmle.python.Stmts
1111
import semmle.python.Exprs
1212
import semmle.python.Keywords
1313
import semmle.python.Comprehensions
14-
import semmle.python.Lists
1514
import semmle.python.Flow
1615
import semmle.python.Metrics
1716
import semmle.python.Constants

python/ql/src/semmle/python/AstExtended.qll

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,59 @@ class StringPartList extends StringPartList_ {
172172

173173
}
174174

175+
/* **** Lists ***/
176+
177+
/** A parameter list */
178+
class ParameterList extends @py_parameter_list {
179+
180+
Function getParent() {
181+
py_parameter_lists(this, result)
182+
}
183+
184+
/** Gets a parameter */
185+
Parameter getAnItem() {
186+
/* Item can be a Name or a Tuple, both of which are expressions */
187+
py_exprs(result, _, this, _)
188+
}
189+
190+
/** Gets the nth parameter */
191+
Parameter getItem(int index) {
192+
/* Item can be a Name or a Tuple, both of which are expressions */
193+
py_exprs(result, _, this, index)
194+
}
195+
196+
string toString() {
197+
result = "ParameterList"
198+
}
199+
}
200+
201+
/** A list of Comprehensions (for generating parts of a set, list or dictionary comprehension) */
202+
class ComprehensionList extends ComprehensionList_ {
203+
204+
}
205+
206+
/** A list of expressions */
207+
class ExprList extends ExprList_ {
208+
209+
}
210+
211+
212+
library class DictItemList extends DictItemList_ {
213+
214+
}
215+
216+
library class DictItemListParent extends DictItemListParent_ {
217+
218+
}
219+
220+
/** A list of strings (the primitive type string not Bytes or Unicode) */
221+
class StringList extends StringList_ {
222+
223+
}
224+
225+
/** A list of aliases in an import statement */
226+
class AliasList extends AliasList_ {
227+
228+
}
229+
230+

python/ql/src/semmle/python/Lists.qll

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)