Author: kjs
Date: Fri Feb 22 04:46:20 2008
New Revision: 25987

Modified:
   trunk/NEWS
   trunk/languages/c99/src/parser/actions.pm
   trunk/languages/c99/t/spi.t

Log:
[c99]
/simplify TOP action a bit
/add a test for while
/add the news about c99 to NEWS.

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS  (original)
+++ trunk/NEWS  Fri Feb 22 04:46:20 2008
@@ -1,5 +1,8 @@
 # $Id$
 
+New in r25986
+- Languages
+  + C99: reimplementation with PCT
 
 New in 0.5.3
 - Documentation

Modified: trunk/languages/c99/src/parser/actions.pm
==============================================================================
--- trunk/languages/c99/src/parser/actions.pm   (original)
+++ trunk/languages/c99/src/parser/actions.pm   Fri Feb 22 04:46:20 2008
@@ -3,7 +3,7 @@
 
 =begin comments
 
-C::Grammar::Actions - ast transformations for C
+C99::Grammar::Actions - ast transformations for C99
 
 This file contains the methods that are used by the parse grammar
 to build the PAST representation of an C program.
@@ -18,18 +18,15 @@
 class C99::Grammar::Actions;
 
 method TOP($/) {
-    my $past;
     for $<external_declaration> {
         my $fun := $( $_ );
 
         ## Look for the "main" function, and set that as the result
         ## object.
         if $fun.name() eq 'main' {
-             $past := $fun;
+             make $fun;
         }
     }
-
-    make $past;
 }
 
 method external_declaration($/, $key) {
@@ -189,6 +186,7 @@
 }
 
 method identifier($/) {
+    ## XXX fix scopes
     make PAST::Var.new( :name( ~$/ ), :scope('package'), :node($/) );
 }
 

Modified: trunk/languages/c99/t/spi.t
==============================================================================
--- trunk/languages/c99/t/spi.t (original)
+++ trunk/languages/c99/t/spi.t Fri Feb 22 04:46:20 2008
@@ -2,7 +2,7 @@
 
 
 void main() {
-    puts("1..4");
+    puts("1..5");
     puts("ok 1");
 
     if (0)
@@ -23,5 +23,10 @@
     }
     while(0);
 
+    while(0) {
+        puts("nok 5");
+    }
+    puts("ok 5");
+
 }
 

Reply via email to