Re: [Pharo-dev] Is there a portable way to check if a string is a block?

2017-08-13 Thread Guillermo Polito
RBParser parseMethod: '...' parses a method RBParser parseExpression: '...' does it for an expression But I think both of them return a method node? I cannot recall. However, you can always do at the end node methodNode statements last isBlockNode or something like that. Can't you? On Su

Re: [Pharo-dev] Is there a portable way to check if a string is a block?

2017-08-12 Thread Eliot Miranda
Hi Mariano, _,,,^..^,,,_ (phone) > On Jul 24, 2017, at 9:21 AM, Mariano Martinez Peck > wrote: > > Hi guys, > > Is there a portable (that would work in GemStone too) and safe way to know if > a String would be a block? > > I must support this kind of strings: > > 'singleString' -> false

Re: [Pharo-dev] Is there a portable way to check if a string is a block?

2017-07-24 Thread Nicolas Cellier
Presumably, you must parse the string (not evaluate), obtain an Abstract Syntax Tree on return (or an Exception), and check that this AST conforms to some pattern (at worse you code naïvly the pattern matching, at best you can reuse the refactor/rewrite engine). I've not followed latest Compiler d