develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34218 - in trunk/languages/perl6/src: builtins parser

From:
pmichaud
Date:
December 21, 2008 10:04
Subject:
[svn:parrot] r34218 - in trunk/languages/perl6/src: builtins parser
Message ID:
20081221180421.6FD6CCBA12@x12.develooper.com
Author: pmichaud
Date: Sun Dec 21 10:04:20 2008
New Revision: 34218

Modified:
   trunk/languages/perl6/src/builtins/math.pir
   trunk/languages/perl6/src/parser/grammar.pg

Log:
[rakudo]:  Add support for Inf and NaN (RT #58014)


Modified: trunk/languages/perl6/src/builtins/math.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/math.pir	(original)
+++ trunk/languages/perl6/src/builtins/math.pir	Sun Dec 21 10:04:20 2008
@@ -135,6 +135,20 @@
     .return ($N0)
 .end
 
+=item Inf / NaN
+
+=cut
+
+.sub 'Inf'
+    $N0 = 'Inf'
+    .return ($N0)
+.end
+
+.sub 'NaN'
+    $N0 = 'NaN'
+    .return ($N0)
+.end
+
 
 =item pi
 

Modified: trunk/languages/perl6/src/parser/grammar.pg
==============================================================================
--- trunk/languages/perl6/src/parser/grammar.pg	(original)
+++ trunk/languages/perl6/src/parser/grammar.pg	Sun Dec 21 10:04:20 2008
@@ -571,12 +571,12 @@
 token term {
     [
     | 'VAR(' <variable> ')' {*}                  #= VAR
-    | <typename> {*}                             #= typename
     | <name=named_0ary>
         [
         | <.unsp>? '.'? '(' <semilist> ')' {*}   #= func args
         | :: {*}                                 #= noarg
         ]
+    | <typename> {*}                             #= typename
     | <name>
         [
         | <args> {*}                             #= args
@@ -595,7 +595,7 @@
 
 ##  XXX: cheat until we get term:pi, term:rand, term:undef, etc.
 token named_0ary {
-    | [pi|rand|undef|nothing|time|next|last|continue|break] >>
+    | [pi|rand|undef|nothing|time|next|last|continue|break|Inf|NaN] >>
     | ['...'|'???'|'!!!'|'=<>']
 }
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About