isSelfPseudoVariable

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

isSelfPseudoVariable

Hernan Wilkinson-3
 
Hi!
 does anybody know why isSelfPseudoVariable checks for name = '{{self}}'?
 I wrote an script to get the method node of all the methods in the image and no one sets {{self}} as name of a VariableNode, the key = 'self' if the one used to identify a VariableNode as a self pseudo var.
 Here is the current implementation:

isSelfPseudoVariable
"Answer if this ParseNode represents the 'self' pseudo-variable."

^ key = 'self' or: [name = '{{self}}']

And here the script I wrote:

| method methodNode |
ProtoObject withAllSubclassesDo: [ :aClass |
   aClass selectors do: [ :aSelector |
       method := aClass >> aSelector.
       methodNode := method methodNode.
       methodNode nodesDo: [ :node |
          (node isSelfPseudoVariable and: [ node name = '{{self}}']) ifTrue: [self halt].
]]]

Thanks!
Hernan.
--
Hernán Wilkinson
Agile Software Development, Teaching & Coaching
Phone: +54-011-4893-2057
Twitter: @HernanWilkinson
Address: Alem 896, Floor 6, Buenos Aires, Argentina