Problem with number parsing in Shout...help needed!

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

Problem with number parsing in Shout...help needed!

Mariano Martinez Peck
If you load Shout-lr.84 and ShoutTests-tween.9 from http://www.squeaksource.com/shout

and run the  testNumbers  it will in:

    s := 'x 16r-d'.   
    types := self tokenTypesIn: s.
    tokens := self tokensIn: s.
    self assert: types = #(patternUnary number unary).
    self assert: tokens = #('x' '16r-' 'd').

because types is  #(#patternUnary #number)
and in addition, tokens is  #('x' '16r-d')

I have no idea about this. Does someone know how to fix it? 

Thanks

mariano




_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Problem with number parsing in Shout...help needed!

Nicolas Cellier
2010/7/2 Mariano Martinez Peck <[hidden email]>:

> If you load Shout-lr.84 and ShoutTests-tween.9 from
> http://www.squeaksource.com/shout
>
> and run the  testNumbers  it will in:
>
>     s := 'x 16r-d'.
>     types := self tokenTypesIn: s.
>     tokens := self tokensIn: s.
>     self assert: types = #(patternUnary number unary).
>     self assert: tokens = #('x' '16r-' 'd').
>

First, try:
    (Compiler evaluate: '16r-d') -> -13.
Then you can conclude 16r-d is a valid number token now.
The test is not up-to-date, so change the test.
I guess this might be related to enablement of lower case letters in
number literals...

Nicolas

> because types is  #(#patternUnary #number)
> and in addition, tokens is  #('x' '16r-d')
>
> I have no idea about this. Does someone know how to fix it?
>
> Thanks
>
> mariano
>
>
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project