On 23 July 2010 11:58, Fernando olivero <[email protected]> wrote:
> Thanks for the pointers Lukas,
>
> Works now!
>
>>>canSuccesfullyParse: aSource in: aClass
>        [ parsedNode := RBParser parseMethod: aSource onError: [:descrip 
> :position| evaluation := false. errorDescription := descrip. errorPosition := 
> position ] ] on: Error do:[:err|  ].
>        parsedNode annotateInClass: aClass.
>        hasUndeclared := parsedNode allChildren select:[:each| each isVariable 
> and:[ each variableBinding isUndeclaredBinding  ]] .
>        hasUndeclared ifTrue:[ self .... ].

Yep, something like that. You shouldn't need the Error handler,
otherwise that would be a bug in the RBParser.

Also you might want to check for shadowed variables (#isShadowed),
because they cause the compiler to complain.

Lukas

-- 
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to