# New Ticket Created by  Bernhard Schmalhofer 
# Please include the string:  [perl #22548]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=22548 >


Hi,

I'm playing around with targeting Ruby for Parrot. One of the first 
things I'm looking at are number literals in Perl6 and Ruby. The only 
difference I encountered so far is that Perl likes the literal 
'10______0', wheras Ruby insists on at most a single '_' between digits.
This seems to be a matter of taste.

Trying to steal from perl6/P6C/Grammar.pm, I noticed that e.g. 0.1E+2 
isn't parsed. So there is a mini patch attached. Also attached is a new 
test languages/perl6/t/builtins/number.t

CU, Bernhard

-- 
*************************************************
Bernhard Schmalhofer
Senior Developer

Biomax Informatics AG
Lochhamer Str. 11
82152 Martinsried, Germany

Tel:    +49 89 89 55 74 - 839
Fax:    +49 89 89 55 74 - 25
PGP:    https://ssl.biomax.de/pgp/
Email:  mailto:[EMAIL PROTECTED]
Web:    http://www.biomax.de
*************************************************


-- attachment  1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/58680/43679/eb70b4/positive_exponent.patch

-- attachment  2 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/58680/43680/815988/number.t

diff --recursive -u parrot/languages/perl6/P6C/Parser.pm 
parrot_20030603/languages/perl6/P6C/Parser.pm
--- parrot/languages/perl6/P6C/Parser.pm        Sat Dec 28 01:00:18 2002
+++ parrot_20030603/languages/perl6/P6C/Parser.pm       Tue Jun  3 19:15:44 2003
@@ -262,7 +262,7 @@
     # Used for flushing syntax errors
     $FLUSH     = qr/\w+|[^\s\w;}#'"]+/;
     $NUMPART   = qr/(?!_)[\d_]+(?<!_)/;
-    $NUMBER = qr/(?:$NUMPART(?:\.$NUMPART)?|\.$NUMPART)(?:[Ee]-?$NUMPART)?/o;
+    $NUMBER     = qr/(?:$NUMPART(?:\.$NUMPART)?|\.$NUMPART)(?:[Ee][+-]?$NUMPART)?/o;
     $HEXCHAR   = qr/[a-fA-F0-9]{2,4}/;
     $RXESCAPED = qr/\\(?:[Xx]$HEXCHAR|0[0-7]{1,3}|[Xx]\{$HEXCHAR\}|[Pp]\{\w+\}|.)/o;
     $RXASSERTION= qr/:{1,3}|\^{1,2}|\${1,2}/;
Only in parrot_20030603/languages/perl6/t/builtins: number.t

Reply via email to