diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2016-01-07 12:06:11 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-01-07 12:06:11 -0500 |
commit | ca465b6eb54960f4a8be4481a5b2501614c6aa00 (patch) | |
tree | 77f9d087408d40d8e6710ec467a5af45348fbbef /coverage/parser.py | |
parent | a4daf4907f064aeeff789d5679e90452eb24ef8b (diff) | |
download | python-coveragepy-ca465b6eb54960f4a8be4481a5b2501614c6aa00.tar.gz |
Clean up small stuff
Diffstat (limited to 'coverage/parser.py')
-rw-r--r-- | coverage/parser.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/coverage/parser.py b/coverage/parser.py index 16419ca..c03a308 100644 --- a/coverage/parser.py +++ b/coverage/parser.py @@ -253,6 +253,12 @@ class PythonParser(object): self.statements = self.first_lines(starts) - ignore def arcs(self): + """Get information about the arcs available in the code. + + Returns a set of line number pairs. Line numbers have been normalized + to the first line of multi-line statements. + + """ if self._all_arcs is None: aaa = AstArcAnalyzer(self.text, self.raw_funcdefs, self.raw_classdefs) arcs = aaa.collect_arcs() @@ -298,10 +304,12 @@ class LoopBlock(object): self.start = start self.break_exits = set() + class FunctionBlock(object): def __init__(self, start): self.start = start + class TryBlock(object): def __init__(self, handler_start=None, final_start=None): self.handler_start = handler_start # TODO: is this used? @@ -803,6 +811,7 @@ def is_simple_value(value): isinstance(value, (string_class, int, float)) ) +# TODO: a test of ast_dump? def ast_dump(node, depth=0): indent = " " * depth if not isinstance(node, ast.AST): |