The Trunk: Kernel-nice2.403.mcz

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

The Trunk: Kernel-nice2.403.mcz

commits-2
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice2.403.mcz

==================== Summary ====================

Name: Kernel-nice2.403
Author: nice
Time: 24 February 2010, 11:59:00.675 am
UUID: 49e07394-1a62-5e4f-a326-9dbdf0513919
Ancestors: Kernel-nice.402

1) Introduce a Number class>>#readSqueakSyntaxFrom:  for Compiler/Scanner. This will later enable introduction of extended for #readFrom:
2) Connect the hook for allowing leading + sign in Integer reading.

This is a correction of Kernel-nice.403

=============== Diff against Kernel-nice.402 ===============

Item was added:
+ ----- Method: Number class>>readSqueakSyntaxFrom: (in category 'instance creation') -----
+ 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!

Item was changed:
  ----- Method: NumberParser>>nextIntegerBase:ifFail: (in category 'parsing-public') -----
  nextIntegerBase: aRadix ifFail: aBlock
+ "Form an integer with optional sign and following digits from sourceStream."
- "Form an integer with following digits"
 
  | isNeg value |
+ isNeg := self peekSignIsMinus.
- isNeg := sourceStream peekFor: $-.
  value := self nextUnsignedIntegerOrNilBase: aRadix.
  value isNil ifTrue: [^aBlock value].
  ^isNeg
  ifTrue: [value negated]
  ifFalse: [value]!