public static parseDeclarations(source as String) as ArrayList<DeclarationNode>
Parses top-level Python classes and functions along with class methods.
| Parameter | Description |
|---|---|
source | Full Python source code text. |
List of top-level DeclarationNodes.
import klyn.code.python
nodes = PythonParser.parseDeclarations("def helper(x):\n return x\n")
assert nodes.size == 1
assert nodes[0].name == "helper"