[Pharo-project] Problem with number parsing in Shout...help needed!
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
2010/7/2 Mariano Martinez Peck <marianopeck@gmail.com>:
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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
participants (2)
-
Mariano Martinez Peck -
Nicolas Cellier