Skip to content

Commit

Permalink
del closing parenthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinHock committed May 5, 2018
1 parent 8e197ad commit 1d0f444
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyt/cfg/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ This is the relevant part of the `abstract grammar`_
# Note: stmt* means any number of statements.
Upon visiting an if: statement we will enter visit_If in `stmt_visitor.py`_. Since we know that the test is just one expression, we can just call self.visit() on it. The body could be an infinite number of statements, so we use the `stmt_star_handler`_ function.
Upon visiting an if: statement we will enter `visit_If`_ in `stmt_visitor.py`_. Since we know that the test is just one expression, we can just call self.visit() on it. The body could be an infinite number of statements, so we use the `stmt_star_handler`_ function.

`stmt_star_handler`_ returns a namedtuple (`ConnectStatements`_) with the first statement, last_statements and break_statements of all of the statements that were in the body of the node. `stmt_star_handler`_ takes care of connecting each statement in the body to the next one.

We then connect the test node to the first node in the body (if some_condition -> x = 5) and return a namedtuple (`ControlFlowNode`_) with the test, last_statements and break_statements.


.. _visit\_If: https://github.com/python-security/pyt/blob/re_organize_code/pyt/cfg/stmt_visitor.py#L208-L232

.. _ConnectStatements: https://github.com/python-security/pyt/blob/re_organize_code/pyt/cfg/stmt_visitor_helper.py#L15

.. _ControlFlowNode: https://github.com/python-security/pyt/blob/re_organize_code/pyt/core/node_types.py#L7
Expand Down

0 comments on commit 1d0f444

Please sign in to comment.