The Refactoring Browser introduces compile errors in methods with ScaledDecimal literals. It replaces 0s with 0 s and 100s with 100 s.
Does anyone know how to fix or work around this?
Cheers,
Bernhard
Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig
num
| num |
num := 0s.
^num
num
| num a |
a := 0 s.
num := a.
^num
RBParser parseExpression: '0s'
scanNumberWithoutExponent
...
(currentCharacter == $r ...)
ifTrue: ...
ifFalse: [number := base]
readSmalltalkSyntaxFrom:
(aStream peekFor: $r)
ifTrue: ...
ifFalse: [self readSmalltalkFloat: ... from: ...]
self chooseFloatRepresentationFor: eChar
chooseFloatRepresentationFor: exponentChar
(('deqs' includes: exponentChar)
or: [SystemUtils isVW20LanguageCompatible
and: [exponentChar = $f]])
ifFalse: [^nil].
exponentChar == Float exponentCharacter
ifTrue: [^Float].
(exponentChar == Double exponentCharacter
or: [exponentChar == Double altExponentCharacter])
ifTrue: [^Double].
(exponentChar == FixedPoint exponentCharacter
or: [exponentChar == $f])
ifTrue: [^FixedPoint].
^self error: (#errExponentNotSupported << #dialogs >> 'This exponent character has not been adequately supported')
readSmalltalkFloat: integerPart from: aStream
...
...
eChar == nil
ifTrue: [possibleCoercionClass := nil]
ifFalse:
[SystemUtils isVW20LanguageCompatible ifTrue: [eChar := eChar asLowercase].
possibleCoercionClass := self chooseFloatRepresentationFor: eChar.
possibleCoercionClass == nil ifFalse: [aStream next]].
exp := nil.
possibleCoercionClass == nil
ifFalse:
[coercionClass := possibleCoercionClass.
endOfNumber := aStream position.
neg := aStream peekFor: $-.
((digit := aStream peek) notNil and: [digit isDigit])
ifTrue:
[exp := self readIntegerFrom: aStream radix: 10.
neg ifTrue: [exp := exp negated]]
ifFalse: [aStream position: endOfNumber]].
value := integerPart + (num / den). "The exponent will be added in the next step."
^self
coerce: value
to: coercionClass
precision: precision
exponent: exp
exponentChar: eChar
Anyone knowing suitable methods please indicate.
Return to VA Smalltalk 7.0, 7.5 & 8.0
Users browsing this forum: Yahoo [Bot] and 1 guest