2010/8/26 Guillermo Polito <guillermopolito@gmail.com>:
Maybe the parser should have a #readXXX for each #nextXXX. Â And let the #readXXX check the for the end of the stream.
yes, that the idea, something like readFrom: aStream ifFail: aBlock | result | result := nextFrom: aStream ifFail: [^aBlock value]. (aStream skipSeparators; atEnd) ifFalse: [self error: 'nothing more expected']. ^result Nicolas
On Thu, Aug 26, 2010 at 11:43 AM, Guillermo Polito <guillermopolito@gmail.com> wrote:
On Thu, Aug 26, 2010 at 10:32 AM, Johan Brichau <johan@inceptive.be> wrote:
On 26 Aug 2010, at 15:09, Guillermo Polito wrote:
Number readFrom: '3foo'. --> exception Number readFrom: '3foo' readStream --> 3
They both return 3 in my image. The comment of #readFrom: also says so that that is the expected behavior. But I'm not sure this is what we want.
Yes, you're right. Â I meant 'foo3' :(.
String>>asNumber should fail :).
agreed. _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project