collections
¶
Group ASTx collection-oriented AST helpers behind one stable package boundary while re-exporting the current public node names.
Modules:
Classes:
-
CollectionContains– -
CollectionCount– -
CollectionIndex– -
CollectionIsEmpty– -
CollectionLength– -
ListAppend– -
ListCreate– -
ListIndex– -
ListLength–
CollectionContains
¶
Bases: DataType
Return whether a list, tuple, or set contains a value, or whether a dictionary contains a key. attributes: base: type: astx.AST value: type: astx.AST type_: type: astx.Boolean
Methods:
-
get_struct– -
to_json– -
to_yaml–
Source code in packages/astx/src/astx/collections/common.py
131 132 133 134 135 136 137 138 139 140 141 142 143 | |
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/collections/common.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | |
to_json
¶
Source code in packages/astx/src/astx/base.py
400 401 402 403 404 405 406 407 408 409 | |
to_yaml
¶
Source code in packages/astx/src/astx/base.py
387 388 389 390 391 392 393 394 395 396 397 398 | |
CollectionCount
¶
Bases: DataType
Return how many times a value appears in a list or tuple as an Int32 value. attributes: base: type: astx.AST value: type: astx.AST type_: type: astx.Int32
Methods:
-
get_struct– -
to_json– -
to_yaml–
Source code in packages/astx/src/astx/collections/common.py
243 244 245 246 247 248 249 250 251 252 253 254 255 | |
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/collections/common.py
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | |
to_json
¶
Source code in packages/astx/src/astx/base.py
400 401 402 403 404 405 406 407 408 409 | |
to_yaml
¶
Source code in packages/astx/src/astx/base.py
387 388 389 390 391 392 393 394 395 396 397 398 | |
CollectionIndex
¶
Bases: DataType
Return the first zero-based index of a value in a list or tuple. The initial ASTx contract returns -1 when the value is not found. attributes: base: type: astx.AST value: type: astx.AST type_: type: astx.Int32
Methods:
-
get_struct– -
to_json– -
to_yaml–
Source code in packages/astx/src/astx/collections/common.py
187 188 189 190 191 192 193 194 195 196 197 198 199 | |
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/collections/common.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | |
to_json
¶
Source code in packages/astx/src/astx/base.py
400 401 402 403 404 405 406 407 408 409 | |
to_yaml
¶
Source code in packages/astx/src/astx/base.py
387 388 389 390 391 392 393 394 395 396 397 398 | |
CollectionIsEmpty
¶
CollectionIsEmpty(base: AST)
Bases: DataType
Return whether a list, tuple, set, or dictionary has no logical entries. attributes: base: type: astx.AST type_: type: astx.Boolean
Methods:
-
get_struct– -
to_json– -
to_yaml–
Source code in packages/astx/src/astx/collections/common.py
81 82 83 84 85 86 87 88 89 90 | |
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/collections/common.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
to_json
¶
Source code in packages/astx/src/astx/base.py
400 401 402 403 404 405 406 407 408 409 | |
to_yaml
¶
Source code in packages/astx/src/astx/base.py
387 388 389 390 391 392 393 394 395 396 397 398 | |
CollectionLength
¶
CollectionLength(base: AST)
Bases: DataType
Return the logical length of a list, tuple, set, or dictionary as an Int32 value. attributes: base: type: astx.AST type_: type: astx.Int32
Methods:
-
get_struct– -
to_json– -
to_yaml–
Source code in packages/astx/src/astx/collections/common.py
35 36 37 38 39 40 41 42 43 44 | |
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/collections/common.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
to_json
¶
Source code in packages/astx/src/astx/base.py
400 401 402 403 404 405 406 407 408 409 | |
to_yaml
¶
Source code in packages/astx/src/astx/base.py
387 388 389 390 391 392 393 394 395 396 397 398 | |
ListAppend
¶
Bases: DataType
Append one value to an existing mutable list variable or field. This node models incremental list growth and is not a user-facing collection API by itself. attributes: base: type: astx.AST value: type: astx.AST type_: type: astx.Int32
Methods:
-
get_struct– -
to_json– -
to_yaml–
Source code in packages/astx/src/astx/collections/list.py
139 140 141 142 143 144 145 146 147 148 149 150 151 | |
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/collections/list.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |
to_json
¶
Source code in packages/astx/src/astx/base.py
400 401 402 403 404 405 406 407 408 409 | |
to_yaml
¶
Source code in packages/astx/src/astx/base.py
387 388 389 390 391 392 393 394 395 396 397 398 | |
ListCreate
¶
ListCreate(element_type: DataType)
Bases: DataType
Methods:
-
get_struct– -
to_json– -
to_yaml–
Source code in packages/astx/src/astx/collections/list.py
33 34 35 36 37 38 39 40 41 42 | |
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/collections/list.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |
to_json
¶
Source code in packages/astx/src/astx/base.py
400 401 402 403 404 405 406 407 408 409 | |
to_yaml
¶
Source code in packages/astx/src/astx/base.py
387 388 389 390 391 392 393 394 395 396 397 398 | |
ListIndex
¶
Bases: DataType
Read one element from a list-valued expression using one integer index. attributes: base: type: astx.AST index: type: astx.AST type_: type: astx.DataType
Methods:
-
get_struct– -
to_json– -
to_yaml–
Source code in packages/astx/src/astx/collections/list.py
82 83 84 85 86 87 88 89 90 91 92 93 94 | |
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/collections/list.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
to_json
¶
Source code in packages/astx/src/astx/base.py
400 401 402 403 404 405 406 407 408 409 | |
to_yaml
¶
Source code in packages/astx/src/astx/base.py
387 388 389 390 391 392 393 394 395 396 397 398 | |
ListLength
¶
ListLength(base: AST)
Bases: DataType
Return the current logical length of one list-valued expression as an int32 value. The runtime stores list lengths as int64, but the current ASTx language-level contract intentionally truncates that representation to Int32. attributes: base: type: astx.AST type_: type: astx.Int32
Methods:
-
get_struct– -
to_json– -
to_yaml–
Source code in packages/astx/src/astx/collections/list.py
194 195 196 197 198 199 200 201 202 203 | |
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/astx/src/astx/collections/list.py
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |
to_json
¶
Source code in packages/astx/src/astx/base.py
400 401 402 403 404 405 406 407 408 409 | |
to_yaml
¶
Source code in packages/astx/src/astx/base.py
387 388 389 390 391 392 393 394 395 396 397 398 | |