Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0007755 [Squeak] Compiler minor always 03-14-13 10:45 05-12-14 22:15
Reporter FrankShearar View Status public  
Assigned To nicolas cellier
Priority normal Resolution fixed Platform
Status resolved   OS
Projection none   OS Version
ETA none Fixed in Version trunk Product Version trunk
  Product Build
Summary 0007755: "1.0s" does not parse
Description David Gorisek <david.gorisek@e-racuni.com> sent this to the Pharo list:

Hello all,

I am testing Pharo and I have noticed that the Pharo compiler does not treat ScaledDecimals the same way they are treated in other Smalltalk dialects (e.g. VW, VAST, Dolphin, STX, etc.).

For example the following is a valid code representing an instance of ScaledDecimal/FixedPoint in all other dialect.

1.0s + 2.0s

In Phare the code above wont compile, it has to be written as:

1.0s1 + 2.0s1

So I have made the following quick change to make Pharo compatible with other Smalltalk dialects. Maybe this change could be included in the next version of Pharo?

SqNumberParser>>#readScale
    "read the scale if any (stored in instVar).
    Answer true if found, answer false if none.
    If scale letter is not followed by a digit, this is not considered as an error.
    Scales are always read in base 10, though i do not see why..."

    scale := 0.
    sourceStream atEnd
        ifTrue: [ ^ false ].
    (sourceStream peekFor: $s)
        ifFalse: [ ^ false ].
    scale := self nextUnsignedIntegerOrNilBase: 10.
    scale
        ifNil: [
            scale := 0.
            (sourceStream peek ifNil: [false] ifNotNil: [ :nextChar | nextChar isLetter])
                ifTrue: [
                    sourceStream skip: -1. "ungobble the s"
                    ^ false ]
                ifFalse: [ ^ true ] ].
    ^ true
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0014498 - 76 - 82 - 232 - 232 - 232 - 232)
nicolas cellier
05-12-14 22:15

Fixed in trunk (4.6)
See http://source.squeak.org/trunk/Kernel-nice.849.mcz [^]
 

- Issue History
Date Modified Username Field Change
03-14-13 10:45 FrankShearar New Issue
05-12-14 22:15 nicolas cellier Status new => resolved
05-12-14 22:15 nicolas cellier Fixed in Version  => trunk
05-12-14 22:15 nicolas cellier Resolution open => fixed
05-12-14 22:15 nicolas cellier Assigned To  => nicolas cellier
05-12-14 22:15 nicolas cellier Note Added: 0014498


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
36 total queries executed.
31 unique queries executed.
Powered by Mantis Bugtracker