The Trunk: Kernel-nice.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-nice.403.mcz

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

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

Name: Kernel-nice.403
Author: nice
Time: 23 February 2010, 2:39:40.246 pm
UUID: b3db5f5a-bd5e-ce46-965a-f108c7608d2a
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.

=============== 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 := sourceStream peekSignIsMinus.
- isNeg := sourceStream peekFor: $-.
  value := self nextUnsignedIntegerOrNilBase: aRadix.
  value isNil ifTrue: [^aBlock value].
  ^isNeg
  ifTrue: [value negated]
  ifFalse: [value]!