[johnson-talk] Browse a mutable tree

4 views
Skip to first unread message

greg

unread,
Apr 27, 2010, 4:33:17 AM4/27/10
to Johnson
Hello dear Johnson developers and users,

Johnson seems to be a good library to manipulate JS code in a Ruby
program but is still under (active?) development. Therefore, I guess
some functions may not be implemented.

I happened to come across a function that is not mentionned in the
documentation and may not work. Still I do not have any idea to test
it.

When using the method "methods" on a Johnson::Nodes::FunctionCall
instance in irb, a method called "taint" is listed. How can it be
used?

Actually I want to browse a Mutable tree but there is no way to do it
properly (non redundantly) using the method each. Also, I wanted to
find a way to look for a given object in the mutable tree, so I
transformed it to an enumerator and used the function find/find_all
but still it feels really awkward using it since I am not able to get
a field alone.

Thank you in advance for any suggestion to do so.

Regards,

greg/


--
Subscription settings: http://groups.google.com/group/johnson-talk/subscribe?hl=en

Gregory Blanc

unread,
Jul 19, 2010, 9:07:24 PM7/19/10
to Johnson
Dear Johnson developers and users,

it is me again. I think last time my explanation was a bit confusing
and I
think my question simply goes down to the title. The mutable tree is
not
a real tree structure. Therefore, is there a way to browse it?
Obviously,
using the each iterator...

However, if I want to start browsing from a given node or leaf? How do
I perform such operation? If I want to browse back from a child node
to
a parent node? How do I do? Is there a way to refer from parent or
child
node from a given node?

I browsed the documentation (well, what is available), ran some test
cases
but was not able to answer the above questions.

I humbly wish someone would be kindly enough to enlighten me. And if
there is no such operations implemented, I suggest it as an
improvement,
if you see like me any benefit in doing so.

Regards,

greg/

Reply all
Reply to author
Forward
0 new messages