(nodeList)
| 122 | |
| 123 | |
| 124 | def generateAstAssignableExpression(nodeList): |
| 125 | targets = [] |
| 126 | for node in nodeList: |
| 127 | if node["type"] == "PY_IDENTIFIER": |
| 128 | identifier = node["properties"]["identifier"] |
| 129 | targets.append(ast.Name(identifier, ctx=ast.Store())) |
| 130 | elif node["type"] == "PYTHON_SUBSCRIPT": |
| 131 | targets.append(generateSubscript(node, context=ast.Store())) |
| 132 | else: |
| 133 | raise Exception(f'Unrecognised assignable expression token: {node["type"]}') |
| 134 | if len(targets) > 1: |
| 135 | return ast.Tuple(targets, ast.Store()) |
| 136 | return targets[0] |
| 137 | |
| 138 | |
| 139 | def parseLeaf(tokens, currentIndex): |
no test coverage detected