'From Squeak3.11alpha of 13 February 2010 [latest update: #9483] on 9 March 2010 at 11:11:23 am'! !Number class methodsFor: 'instance creation' stamp: 'nice 2/22/2010 21:41'! readSqueakSyntaxFrom: stringOrStream "Answer a number as described on aStream. The number may be any accepted Smalltalk literal Number format. It can include a leading radix specification, as in 16rFADE. It can as well be NaN, Infinity or -Infinity for conveniency. If stringOrStream does not start with a valid number description, fail." ^(SqNumberParser on: stringOrStream) nextNumber! ! !NumberParser methodsFor: 'parsing-public' stamp: 'nice 2/23/2010 15:21'! nextIntegerBase: aRadix ifFail: aBlock "Form an integer with optional sign and following digits from sourceStream." | isNeg value | isNeg := self peekSignIsMinus. value := self nextUnsignedIntegerOrNilBase: aRadix. value isNil ifTrue: [^aBlock value]. ^isNeg ifTrue: [value negated] ifFalse: [value]! !