Magritte MAStringReader >> visitNumberDescription: validation error for negative exponents

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

Magritte MAStringReader >> visitNumberDescription: validation error for negative exponents

Ben Coman
hi all,

Where do Magritte errors get logged?  On Moose tracker or somewhere else?

There is a defect in validation of numbers like 3.48e-5
since Magritte MAStringReader >> visitNumberDescription: only allows a
dash at the start.

I've included the details below just so I don't lose them.

regards -ben



MAStringReader >>visitNumberDescription: aDescription
    | contents |

    (aDescription label first = $r) ifTrue: [ self haltOnce ].
    contents := self contents.
    contents isEmpty
        ifTrue: [ MAReadError signal ].
    (contents occurrencesOf: $-) > 1
        ifTrue: [ MAReadError signal ].

    (contents indexOf: $-) > 1
        ifTrue: [ MAReadError signal ].
"^^^^^"
    (contents occurrencesOf: $.) > 1
        ifTrue: [ MAReadError signal ].
    (contents allSatisfy: [ :each | '+-0123456789.eE' includes: each ])
        ifFalse: [ MAReadError signal ].
    super visitNumberDescription: aDescription
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev