develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r34958 - in branches/pct_hll: compilers/pct/src/PCT compilers/pge/PGE languages/lolcode/src/parser languages/perl6 languages/perl6/src/classes languages/perl6/src/parser

From:
tene
Date:
January 4, 2009 21:35
Subject:
[svn:parrot] r34958 - in branches/pct_hll: compilers/pct/src/PCT compilers/pge/PGE languages/lolcode/src/parser languages/perl6 languages/perl6/src/classes languages/perl6/src/parser
Message ID:
20090105053549.A0CD4CB9F9@x12.develooper.com
Author: tene
Date: Sun Jan  4 21:35:48 2009
New Revision: 34958

Modified:
   branches/pct_hll/compilers/pct/src/PCT/HLLCompiler.pir
   branches/pct_hll/compilers/pge/PGE/Match.pir
   branches/pct_hll/languages/lolcode/src/parser/actions.pm
   branches/pct_hll/languages/perl6/perl6.pir
   branches/pct_hll/languages/perl6/src/classes/List.pir
   branches/pct_hll/languages/perl6/src/parser/actions.pm

Log:
Fix some typos.  Looks like rakudo works in its own HLL pretty well now.

Modified: branches/pct_hll/compilers/pct/src/PCT/HLLCompiler.pir
==============================================================================
--- branches/pct_hll/compilers/pct/src/PCT/HLLCompiler.pir	(original)
+++ branches/pct_hll/compilers/pct/src/PCT/HLLCompiler.pir	Sun Jan  4 21:35:48 2009
@@ -441,10 +441,10 @@
     .tailcall astbuilder.'get'('past')
 
   compile_match:
-    push_eh err_past
+    #push_eh err_past
     .local pmc ast
     ast = source.'item'()
-    pop_eh
+    #pop_eh
     $I0 = isa ast, ['PAST';'Node']
     unless $I0 goto err_past
     .return (ast)

Modified: branches/pct_hll/compilers/pge/PGE/Match.pir
==============================================================================
--- branches/pct_hll/compilers/pge/PGE/Match.pir	(original)
+++ branches/pct_hll/compilers/pge/PGE/Match.pir	Sun Jan  4 21:35:48 2009
@@ -114,9 +114,10 @@
     ne $S0, 'String', have_grammar
     $S0 = grammar
     $P0 = split '::', $S0
-  have_grammar:
     grammar_class = get_class $P0
     goto with_grammar
+  have_grammar:
+    grammar_class = grammar
   grammar_namespace:
     grammar_class = get_class grammar
   with_grammar:

Modified: branches/pct_hll/languages/lolcode/src/parser/actions.pm
==============================================================================
--- branches/pct_hll/languages/lolcode/src/parser/actions.pm	(original)
+++ branches/pct_hll/languages/lolcode/src/parser/actions.pm	Sun Jan  4 21:35:48 2009
@@ -22,6 +22,7 @@
     $block.symbol('IT', :scope('lexical'));
     my $it := PAST::Var.new( :name( 'IT' ), :scope('lexical'), :viviself('Undef'), :isdecl(1));
     $block.unshift($it);
+    $block.hll('lolcode');
     make $block;
 }
 

Modified: branches/pct_hll/languages/perl6/perl6.pir
==============================================================================
--- branches/pct_hll/languages/perl6/perl6.pir	(original)
+++ branches/pct_hll/languages/perl6/perl6.pir	Sun Jan  4 21:35:48 2009
@@ -26,17 +26,27 @@
 .loadlib 'perl6_ops'
 .include 'src/gen_builtins.pir'
 
-.namespace [ 'Perl6';'Compiler' ]
-
-.sub 'onload' :load :init :anon
+.sub '' :load :init :anon
     load_bytecode 'PCT.pbc'
 
     .local pmc parrotns, hllns, exports
     parrotns = get_root_namespace ['parrot']
     hllns = get_hll_namespace
-    exports = split ' ', 'PGE PAST'
+    exports = split ' ', 'PGE PAST PCT'
     parrotns.'export_to'(hllns, exports)
+.end
+
+.include 'src/gen_grammar.pir'
+.include 'src/parser/expression.pir'
+.include 'src/parser/quote_expression.pir'
+.include 'src/gen_actions.pir'
+.include 'src/gen_metaop.pir'
+.include 'src/gen_junction.pir'
+
 
+.namespace [ 'Perl6';'Compiler' ]
+
+.sub 'onload' :load :init :anon
     .local pmc p6meta, perl6
     p6meta = get_hll_global ['Perl6Object'], '$!P6META'
     perl6 = p6meta.'new_class'('Perl6::Compiler', 'parent'=>'parrot;PCT::HLLCompiler')
@@ -46,7 +56,7 @@
     perl6.'language'('Perl6')
     $P0 = get_hll_namespace ['Perl6';'Grammar']
     perl6.'parsegrammar'($P0)
-    $P0 = get_hll_namespace ['Perl6';'Grammar';'Action']
+    $P0 = get_hll_namespace ['Perl6';'Grammar';'Actions']
     perl6.'parseactions'($P0)
 
     ##  set the compilation stages in the @stages attribute
@@ -216,14 +226,6 @@
 .end
 
 
-.include 'src/gen_grammar.pir'
-.include 'src/parser/expression.pir'
-.include 'src/parser/quote_expression.pir'
-.include 'src/gen_actions.pir'
-.include 'src/gen_metaop.pir'
-.include 'src/gen_junction.pir'
-
-
 =back
 
 =cut

Modified: branches/pct_hll/languages/perl6/src/classes/List.pir
==============================================================================
--- branches/pct_hll/languages/perl6/src/classes/List.pir	(original)
+++ branches/pct_hll/languages/perl6/src/classes/List.pir	Sun Jan  4 21:35:48 2009
@@ -10,7 +10,7 @@
 .sub '' :anon :load :init
     .local pmc p6meta, listproto
     p6meta = get_hll_global ['Perl6Object'], '$!P6META'
-    listproto = p6meta.'new_class'('List', 'parent'=>'ResizablePMCArray Any')
+    listproto = p6meta.'new_class'('List', 'parent'=>'parrot;ResizablePMCArray Any')
     $P0 = get_hll_global 'Positional'
     p6meta.'add_role'($P0, 'to'=>listproto)
     p6meta.'register'('ResizablePMCArray', 'parent'=>listproto, 'protoobject'=>listproto)
@@ -176,6 +176,8 @@
 
 =cut
 
+.HLL 'parrot'
+
 .namespace ['ResizablePMCArray']
 .sub 'list' :method
     ##  this code morphs a ResizablePMCArray into a List
@@ -188,6 +190,7 @@
     .return (self)
 .end
 
+.HLL 'perl6'
 
 =back
 

Modified: branches/pct_hll/languages/perl6/src/parser/actions.pm
==============================================================================
--- branches/pct_hll/languages/perl6/src/parser/actions.pm	(original)
+++ branches/pct_hll/languages/perl6/src/parser/actions.pm	Sun Jan  4 21:35:48 2009
@@ -8,6 +8,7 @@
     $past.blocktype('declaration');
     declare_implicit_routine_vars($past);
     $past.lexical(0);
+    $past.hll('perl6');
 
     #  Make sure we have the interpinfo constants.
     $past.unshift( PAST::Op.new( :inline('.include "interpinfo.pasm"') ) );
@@ -16,7 +17,7 @@
     $past.unshift(set_package_magical());
 
     # Create the unit's startup block.
-    my $main := PAST::Block.new( :pirflags(':main') );
+    my $main := PAST::Block.new( :pirflags(':main'), :hll('perl6') );
     $main.loadinit().push(
         PAST::Op.new( :inline('$P0 = compreg "Perl6"',
                               'unless null $P0 goto have_perl6',



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