(codeString)
| 338 | return fileNode |
| 339 | |
| 340 | def splootNodeFromPython(codeString): |
| 341 | global lineno |
| 342 | lineno = 1 |
| 343 | tree = ast_comments.parse(codeString) |
| 344 | |
| 345 | if len(tree.body) > 1: |
| 346 | fileNode = {"type":"PYTHON_FILE","properties":{},"childSets":{"body": []}} |
| 347 | fileNode["childSets"]["body"] = getBlockBodyFromStatements(tree.body) |
| 348 | return fileNode |
| 349 | |
| 350 | statement = tree.body[0] |
| 351 | if type(statement) == ast.Expr: |
| 352 | expNode = generateExpression(statement.value) |
| 353 | if len(expNode['childSets']['tokens']) == 1: |
| 354 | return expNode['childSets']['tokens'][0] |
| 355 | return expNode |
| 356 | |
| 357 | statementNode = generateSplootStatement(statement) |
| 358 | return statementNode['childSets']['statement'][0] |
| 359 | |
| 360 | def splootNodesFromPython(codeString): |
| 361 | global lineno |
no test coverage detected