Evaluate an expression stack, returning the set of extension and feature names used in the expression. - stack - the stack
(stack)
| 319 | parenthesize=True, root=True, parent_op=None) |
| 320 | |
| 321 | def evalDependencyNames(stack): |
| 322 | """Evaluate an expression stack, returning the set of extension and |
| 323 | feature names used in the expression. |
| 324 | |
| 325 | - stack - the stack""" |
| 326 | |
| 327 | op, num_args = stack.pop(), 0 |
| 328 | if isinstance(op, tuple): |
| 329 | op, num_args = op |
| 330 | if op in '+,': |
| 331 | # Do not evaluate the operation. We only care about the names. |
| 332 | return evalDependencyNames(stack) | evalDependencyNames(stack) |
| 333 | elif op[0].isalpha(): |
| 334 | return { op } |
| 335 | else: |
| 336 | raise Exception(f'invalid op: {op}') |
| 337 | |
| 338 | def dependencyNames(dependency): |
| 339 | """Return a set of the extension and version names in an API dependency |