Open reuterbal opened 1 year ago
I think this is related to #174. Certainly, the incorrect/unexpected behaviour of index
is down to that.
I can reproduce this:
>>> elsenode = Fortran2003.Else_Stmt("else")
>>> rnode = Fortran2003.Return_Stmt("return")
>>> rnode == elsenode
True
From my investigation in #174, it seems that self.items
is used to compare two instances of Base
and, in this case:
>>> rnode.items
(None,)
>>> elsenode.items
(None,)
I have just run into an odd situation where the following would occur:
I have not dug any deeper into this but it seems unexpected. In my particular case this occurs with an
If_Construct
that looks something like this:From an earlier search I would have the
Else_Stmt
node already available and do something likeif_construct_node.children.index(else_stmt_node)
, which I would expect to yield 3 but instead returns 2.