redbaron icon indicating copy to clipboard operation
redbaron copied to clipboard

Break & Continue Nodes

Open ejcer opened this issue 9 years ago • 3 comments

Any particular reason why those two nodes weren't implemented?

What would their implementation entail?

ejcer avatar Nov 07 '16 04:11 ejcer

Hello,

Those 2 nodes are actually implemented (but I've apparently forgot to document them in the reference page) as you can see:

In [3]: RedBaron("def a():\n break\n continue")[0].value[0].help()
BreakNode()
  # identifiers: break, break_, breaknode

In [4]: RedBaron("def a():\n break\n continue")[0].value[1].help()
ContinueNode()
  # identifiers: continue, continue_, continuenode

Have you encountered a situation where they weren't or raised a bug?

Psycojoker avatar Nov 08 '16 03:11 Psycojoker

my bad, I saw these:

https://github.com/PyCQA/redbaron/blob/master/redbaron/nodes.py#L266

and

https://github.com/PyCQA/redbaron/blob/master/redbaron/nodes.py#L146

and I made the assumption that they weren't implemented.

You rock!

ejcer avatar Nov 11 '16 01:11 ejcer

Reopened to not forget to add documentation for those.

ibizaman avatar Dec 20 '16 05:12 ibizaman