Index: src/Boo.Lang.Parser/boo.g =================================================================== --- src/Boo.Lang.Parser/boo.g (revision 1773) +++ src/Boo.Lang.Parser/boo.g (working copy) @@ -2568,17 +2568,17 @@ INT : ("0x"(HEXDIGIT)+)(('l' | 'L') { $setType(LONG); })? | - (DIGIT)+ + (DIGIT (' '!)?)+ ( ('l' | 'L') { $setType(LONG); } | ( - ({BooLexer.IsDigit(LA(2))}? ('.' (DIGIT)+) { $setType(DOUBLE); })? + ({BooLexer.IsDigit(LA(2))}? ('.' (DIGIT (' ')?)+) { $setType(DOUBLE); })? (("ms" | 's' | 'm' | 'h' | 'd') { $setType(TIMESPAN); })? ) ) ; -DOT : '.' ((DIGIT)+ {$setType(DOUBLE);})?; +DOT : '.' ((DIGIT (' '!)?)+ {$setType(DOUBLE);})?; COLON : ':'; Index: src/Boo.Lang.Parser/booel.g =================================================================== --- src/Boo.Lang.Parser/booel.g (revision 1773) +++ src/Boo.Lang.Parser/booel.g (working copy) @@ -60,17 +60,17 @@ INT : ("0x"(HEXDIGIT)+)(('l' | 'L') { $setType(LONG); })? | - (DIGIT)+ + (DIGIT (' '!)?)+ ( ('l' | 'L') { $setType(LONG); } | ( - ({BooLexer.IsDigit(LA(2))}? ('.' (DIGIT)+) { $setType(DOUBLE); })? + ({BooLexer.IsDigit(LA(2))}? ('.' (DIGIT (' ')?)+) { $setType(DOUBLE); })? (("ms" | 's' | 'm' | 'h' | 'd') { $setType(TIMESPAN); })? ) ) ; -DOT : '.' ((DIGIT)+ {$setType(DOUBLE);})?; +DOT : '.' ((DIGIT (' '!)?)+ {$setType(DOUBLE);})?; COLON : ':'; Index: tests/testcases/compilation/grouping0.boo =================================================================== --- tests/testcases/compilation/grouping0.boo (revision 0) +++ tests/testcases/compilation/grouping0.boo (revision 0) @@ -0,0 +1,41 @@ +""" +1000000 System.Int32 +1000 System.Double +00:16:40 System.TimeSpan +0.001 System.Double +1000 System.Int64 +1000 System.Int64 +1000000 +1000 +00:16:40 +0.001 +1000 +1000 +""" + +n = 1 000 000 +print n, n.GetType() +n2 = 1 000 .00 //can't have space after decimal point +print n2, n2.GetType() +n3 = 1 000 000 ms //timespans and other literals work +print n3, n3.GetType() +n4 = .0 0 1 //only one space allowed btw each number +print n4, n4.GetType() +n5 = 1 000 L +print n5, n5.GetType() +n6 = 1000L +print n6, n6.GetType() + +s = "${1 000 000}" +print s +s2 = "${1 000 .00}" +print s2 +s3 = "${1 000 000 ms}" +print s3 +s4 = "${.0 0 1}" +print s4 +s5 = "${1 000 L}" +print s5 +s6 = "${1000L}" +print s6 +