Author: allison
Date: Fri Oct 5 20:03:13 2007
New Revision: 21906
Removed:
branches/pdd15oo/compilers/pge/PGE/pmc/
Modified:
branches/pdd15oo/MANIFEST
branches/pdd15oo/MANIFEST.SKIP
branches/pdd15oo/compilers/json/JSON.pir
branches/pdd15oo/config/auto/gdbm.pm
branches/pdd15oo/config/auto/gmp.pm
branches/pdd15oo/config/gen/icu.pm
branches/pdd15oo/languages/lua/config/makefiles/root.in
branches/pdd15oo/languages/lua/src/lua51.pg
branches/pdd15oo/languages/lua/src/lua51_testlex.pg
branches/pdd15oo/languages/pheme/lib/PhemeCompiler.pir
branches/pdd15oo/languages/scheme/lib/Scheme.pm
branches/pdd15oo/languages/scheme/lib/Scheme/Builtins.pm
branches/pdd15oo/languages/scheme/lib/Scheme/Generator.pm
branches/pdd15oo/languages/scheme/t/logic/basic.t
branches/pdd15oo/src/pmc/class.pmc
branches/pdd15oo/src/pmc/parrotio.pmc
Log:
[pdd15oo] Bringing the pdd15oo branch up-to-date with trunk 21905.
Modified: branches/pdd15oo/MANIFEST
==============================================================================
--- branches/pdd15oo/MANIFEST (original)
+++ branches/pdd15oo/MANIFEST Fri Oct 5 20:03:13 2007
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Fri Oct 5 06:43:26 2007 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Fri Oct 5 06:45:48 2007 UT
#
# See tools/dev/install_files.pl for documentation on the
# format of this file.
@@ -110,7 +110,6 @@
compilers/pge/PGE/Perl6Regex.pir []
compilers/pge/PGE/Regex.pir []
compilers/pge/PGE/builtins.pg []
-compilers/pge/PGE/pmc/codestring.pmc []
compilers/pge/README.pod []
compilers/pge/STATUS []
compilers/pge/demo.pir []
Modified: branches/pdd15oo/MANIFEST.SKIP
==============================================================================
--- branches/pdd15oo/MANIFEST.SKIP (original)
+++ branches/pdd15oo/MANIFEST.SKIP Fri Oct 5 20:03:13 2007
@@ -1,6 +1,6 @@
# ex: set ro:
# $Id$
-# generated by tools/dev/mk_manifest_and_skip.pl Mon Sep 24 18:00:46 2007 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Fri Oct 5 06:45:48 2007 UT
#
# This file should contain a transcript of the svn:ignore properties
# of the directories in the Parrot subversion repository. (Needed for
@@ -200,33 +200,6 @@
^compilers/pge/PGE/.*\.dll/
^compilers/pge/PGE/builtins_gen\.pir$
^compilers/pge/PGE/builtins_gen\.pir/
-# generated from svn:ignore of 'compilers/pge/PGE/pmc/'
-^compilers/pge/PGE/pmc/.*\.bundle$
-^compilers/pge/PGE/pmc/.*\.bundle/
-^compilers/pge/PGE/pmc/.*\.c$
-^compilers/pge/PGE/pmc/.*\.c/
-^compilers/pge/PGE/pmc/.*\.dll$
-^compilers/pge/PGE/pmc/.*\.dll/
-^compilers/pge/PGE/pmc/.*\.dump$
-^compilers/pge/PGE/pmc/.*\.dump/
-^compilers/pge/PGE/pmc/.*\.exp$
-^compilers/pge/PGE/pmc/.*\.exp/
-^compilers/pge/PGE/pmc/.*\.h$
-^compilers/pge/PGE/pmc/.*\.h/
-^compilers/pge/PGE/pmc/.*\.ilk$
-^compilers/pge/PGE/pmc/.*\.ilk/
-^compilers/pge/PGE/pmc/.*\.lib$
-^compilers/pge/PGE/pmc/.*\.lib/
-^compilers/pge/PGE/pmc/.*\.manifest$
-^compilers/pge/PGE/pmc/.*\.manifest/
-^compilers/pge/PGE/pmc/.*\.o$
-^compilers/pge/PGE/pmc/.*\.o/
-^compilers/pge/PGE/pmc/.*\.obj$
-^compilers/pge/PGE/pmc/.*\.obj/
-^compilers/pge/PGE/pmc/.*\.pdb$
-^compilers/pge/PGE/pmc/.*\.pdb/
-^compilers/pge/PGE/pmc/.*\.so$
-^compilers/pge/PGE/pmc/.*\.so/
# generated from svn:ignore of 'compilers/pirc/'
^compilers/pirc/Makefile$
^compilers/pirc/Makefile/
Modified: branches/pdd15oo/compilers/json/JSON.pir
==============================================================================
--- branches/pdd15oo/compilers/json/JSON.pir (original)
+++ branches/pdd15oo/compilers/json/JSON.pir Fri Oct 5 20:03:13 2007
@@ -53,8 +53,8 @@
.local pmc parse, match
parse = get_root_global ['parrot'; 'JSON'], 'thing'
- $P0 = get_root_global ['parrot'; 'PGE::Match'], 'newfrom'
- match = $P0(json_string)
+ $P0 = get_root_global ['parrot'; 'PGE'], 'Match'
+ match = $P0.'new'(json_string)
match.to(0)
match = parse(match)
unless match goto failed
Modified: branches/pdd15oo/config/auto/gdbm.pm
==============================================================================
--- branches/pdd15oo/config/auto/gdbm.pm (original)
+++ branches/pdd15oo/config/auto/gdbm.pm Fri Oct 5 20:03:13 2007
@@ -30,7 +30,10 @@
sub runstep {
my ( $self, $conf ) = @_;
- my ( $verbose, $without ) = $conf->options->get(@args);
+ my ( $verbose, $without ) = $conf->options->get( qw|
+ verbose
+ without-gmp
+ | );
if ($without) {
$conf->data->set( has_gdbm => 0 );
Modified: branches/pdd15oo/config/auto/gmp.pm
==============================================================================
--- branches/pdd15oo/config/auto/gmp.pm (original)
+++ branches/pdd15oo/config/auto/gmp.pm Fri Oct 5 20:03:13 2007
@@ -29,7 +29,10 @@
sub runstep {
my ( $self, $conf ) = @_;
- my ( $verbose, $without ) = $conf->options->get(@args);
+ my ( $verbose, $without ) = $conf->options->get( qw|
+ verbose
+ without-gmp
+ | );
if ($without) {
$conf->data->set( has_gmp => 0 );
Modified: branches/pdd15oo/config/gen/icu.pm
==============================================================================
--- branches/pdd15oo/config/gen/icu.pm (original)
+++ branches/pdd15oo/config/gen/icu.pm Fri Oct 5 20:03:13 2007
@@ -31,7 +31,15 @@
sub runstep {
my ( $self, $conf ) = @_;
- my ( $verbose, $icushared, $icuheaders, $icuconfig, $without ) =
$conf->options->get(@args);
+ my ( $verbose, $icushared, $icuheaders, $icuconfig, $without ) =
+ $conf->options->get( qw|
+ verbose
+ icushared
+ icuheaders
+ icu-config
+ without-icu
+ |
+ );
my @icu_headers = qw(ucnv.h utypes.h uchar.h);
my $autodetect = !defined($icushared)
Modified: branches/pdd15oo/languages/lua/config/makefiles/root.in
==============================================================================
--- branches/pdd15oo/languages/lua/config/makefiles/root.in (original)
+++ branches/pdd15oo/languages/lua/config/makefiles/root.in Fri Oct 5
20:03:13 2007
@@ -5,7 +5,7 @@
PERL = @perl@
PARROT = ../../[EMAIL PROTECTED]@
PBC_MERGE = ../../[EMAIL PROTECTED]@
-PGE = $(PARROT) ../../compilers/pge/pgc.pir
+PGE = $(PARROT) ../../runtime/parrot/library/PGE/Perl6Grammar.pir
TGE = $(PARROT) ../../compilers/tge/tgc.pir
PMCBUILD = $(PERL) @build_dir@/tools/build/dynpmc.pl
Modified: branches/pdd15oo/languages/lua/src/lua51.pg
==============================================================================
--- branches/pdd15oo/languages/lua/src/lua51.pg (original)
+++ branches/pdd15oo/languages/lua/src/lua51.pg Fri Oct 5 20:03:13 2007
@@ -17,189 +17,189 @@
grammar Lua::Grammar;
token TOP {
- ^ <shebang>? <block> <eof>
+ ^ <shebang>? <block> <eof>
}
rule block {
- [ <statement> <';'>? ]*
+ [ <statement> ';'? ]*
}
rule statement {
- | <expression_stat>
- | <if_stat>
- | <while_stat>
- | <do_block>
- | <for_stat>
- | <repeat_stat>
- | <function_stat>
- | <local_stat>
- | <return_statement>
- | <break_statement>
- | <unexpected>
+ | <expression_stat>
+ | <if_stat>
+ | <while_stat>
+ | <do_block>
+ | <for_stat>
+ | <repeat_stat>
+ | <function_stat>
+ | <local_stat>
+ | <return_statement>
+ | <break_statement>
+ | <unexpected>
}
rule expression_stat {
- <primary_expression> <assignment>?
+ <primary_expression> <assignment>?
}
rule assignment {
- | <','> <primary_expression> <assignment>
- | <'='> <expression_list>
+ | ',' <primary_expression> <assignment>
+ | '=' <expression_list>
}
rule expression_list {
- <expression> [ <','> <expression> ]*
+ <expression> [ ',' <expression> ]*
}
rule if_stat {
- <'if'> <expression> <?then> <block> <elseif_block>* <else_block>? <?end>
+ 'if' <expression> <?then> <block> <elseif_block>* <else_block>? <?end>
}
rule elseif_block {
- <'elseif'> <expression> <?then> <block>
+ 'elseif' <expression> <?then> <block>
}
rule else_block {
- <'else'> <block>
+ 'else' <block>
}
rule while_stat {
- <'while'> <expression> <?do> <block> <?end>
+ 'while' <expression> <?do> <block> <?end>
}
rule do_block {
- <'do'> <block> <?end>
+ 'do' <block> <?end>
}
rule for_stat {
- <'for'> [ <fornum> | <forlist> ] <for_body>
+ 'for' [ <fornum> | <forlist> ] <for_body>
}
rule fornum {
- <name> <'='> <expression> <?comma> <expression> [ <','> <expression> ]?
+ <name> '=' <expression> <?comma> <expression> [ ',' <expression> ]?
}
rule forlist {
- <name_list> <?in> <expression_list>
+ <name_list> <?in> <expression_list>
}
rule for_body {
- <?do> <block> <?end>
+ <?do> <block> <?end>
}
rule repeat_stat {
- <'repeat'> <block> <?until> <expression>
+ 'repeat' <block> <?until> <expression>
}
rule function_stat {
- <'function'> <functionname> <function_body>
+ 'function' <functionname> <function_body>
}
rule functionname {
- <name> [ <'.'> <name> ]* [ <':'> <name> ]?
+ <name> [ '.' <name> ]* [ ':' <name> ]?
}
rule function_body {
- <'('> <parameter_list> <?closeparen> <block> <?end>
+ '(' <parameter_list> <?closeparen> <block> <?end>
}
rule parameter_list {
- | <name_list> [ <','> <vararg> ]?
- | <vararg>?
+ | <name_list> [ ',' <vararg> ]?
+ | <vararg>?
}
rule name_list {
- <name> [ <','> <name> ]*
+ <name> [ ',' <name> ]*
}
rule local_stat {
- <'local'> [ <local_function> | <local_declaration> ]
+ 'local' [ <local_function> | <local_declaration> ]
}
rule local_function {
- <'function'> <name> <function_body>
+ 'function' <name> <function_body>
}
rule local_declaration {
- <name> [ <','> <name> ]* [ <'='> <expression_list> ]?
+ <name> [ ',' <name> ]* [ '=' <expression_list> ]?
}
rule return_statement {
- <'return'> <expression_list>?
+ 'return' <expression_list>?
}
token break_statement {
- <'break'>
+ 'break'
}
rule constructor {
- <'{'> <tablefieldlist>? <?closebrace>
+ '{' <tablefieldlist>? <?closebrace>
}
rule tablefieldlist {
- <tablefield> [ <[,;]> <tablefield> ]* <[,;]>?
+ <tablefield> [ <[,;]> <tablefield> ]* <[,;]>?
}
rule tablefield {
- <record_field> | <expression>
+ <record_field> | <expression>
}
rule record_field {
- [ <name> | <index> ] <'='> <expression>
+ [ <name> | <index> ] '=' <expression>
}
rule index {
- <'['> <expression> <?closebracket>
+ '[' <expression> <?closebracket>
}
rule primary_expression {
- <prefix_expression> <slice_expression>*
+ <prefix_expression> <slice_expression>*
}
rule prefix_expression {
- | <parenthesed_expression>
- | <name>
+ | <parenthesed_expression>
+ | <name>
}
rule parenthesed_expression {
- <'('> <expression> <?closeparen>
+ '(' <expression> <?closeparen>
}
rule slice_expression {
- | <'.'> <name>
- | <index>
- | <':'> <name> <function_args>
- | <function_args>
+ | '.' <name>
+ | <index>
+ | ':' <name> <function_args>
+ | <function_args>
}
rule function_args {
- | <'('> <expression_list>? <?closeparen>
- | <constructor>
- | <string>
+ | '(' <expression_list>? <?closeparen>
+ | <constructor>
+ | <string>
}
rule simple_expression {
- | <number>
- | <string>
- | <nil>
- | <true>
- | <false>
- | <vararg>
- | <constructor>
- | <'function'> <function_body>
- | <primary_expression>
+ | <number>
+ | <string>
+ | <nil>
+ | <true>
+ | <false>
+ | <vararg>
+ | <constructor>
+ | 'function' <function_body>
+ | <primary_expression>
}
@@ -212,39 +212,39 @@
=cut
rule do {
- <'do'> | <syntaxerror: 'do' expected>
+ 'do' | <syntaxerror: 'do' expected>
}
rule then {
- <'then'> | <syntaxerror: 'then' expected>
+ 'then' | <syntaxerror: 'then' expected>
}
rule end {
- <'end'> | <syntaxerror: 'end' expected>
+ 'end' | <syntaxerror: 'end' expected>
}
rule until {
- <'until'> | <syntaxerror: 'until' expected>
+ 'until' | <syntaxerror: 'until' expected>
}
rule comma {
- <','> | <syntaxerror: ',' expected>
+ ',' | <syntaxerror: ',' expected>
}
rule in {
- <'in'> | <syntaxerror: 'in' expected>
+ 'in' | <syntaxerror: 'in' expected>
}
rule closebracket {
- <']'> | <syntaxerror: ']' expected>
+ ']' | <syntaxerror: ']' expected>
}
rule closebrace {
- <'}'> | <syntaxerror: '}' expected>
+ '}' | <syntaxerror: '}' expected>
}
rule closeparen {
- <')'> | <syntaxerror: ')' expected>
+ ')' | <syntaxerror: ')' expected>
}
@@ -256,40 +256,40 @@
=cut
token string {
- | \" <quoted_literal: "> \"
- | \' <quoted_literal: '> \'
- | <long_string>
+ | \" <quoted_literal: "> \"
+ | \' <quoted_literal: '> \'
+ | <long_string>
}
token nil {
- <'nil'>
+ 'nil'
}
token true {
- <'true'>
+ 'true'
}
token false {
- <'false'>
+ 'false'
}
token vararg {
- <'...'>
+ '...'
}
token ws {
[ \s+
- | <'--'> <long_comment>
- | <'--'> \N*
+ | '--' <long_comment>
+ | '--' \N*
]*
}
token eof {
- $ | <syntaxerror: 'eof' expected>
+ $ | <syntaxerror: 'eof' expected>
}
token shebang {
- <'#'> \N*
+ '#' \N*
}
=head2 EXPRESSIONS
Modified: branches/pdd15oo/languages/lua/src/lua51_testlex.pg
==============================================================================
--- branches/pdd15oo/languages/lua/src/lua51_testlex.pg (original)
+++ branches/pdd15oo/languages/lua/src/lua51_testlex.pg Fri Oct 5 20:03:13 2007
@@ -28,68 +28,68 @@
grammar Lua::TestLex
rule TOP {
- (^ <shebang>)? <token>* [ $ | <die>]
+ (^ <shebang>)? <token>* [ $ | <die>]
}
rule token {
- | <Name>
- | <keyword>
- | <String>
- | <Number>
- | <punctuator>
+ | <Name>
+ | <keyword>
+ | <String>
+ | <Number>
+ | <punctuator>
}
token keyword {
- | and
- | break
- | do
- | elseif
- | else
- | end
- | false
- | for
- | function
- | if
- | in
- | local
- | nil
- | not
- | or
- | repeat
- | return
- | then
- | true
- | until
- | while
+ | and
+ | break
+ | do
+ | elseif
+ | else
+ | end
+ | false
+ | for
+ | function
+ | if
+ | in
+ | local
+ | nil
+ | not
+ | or
+ | repeat
+ | return
+ | then
+ | true
+ | until
+ | while
}
token punctuator {
- | \+
- | \-
- | \#
- | \*
- | \/
- | \%
- | \^
- | \.\.\.
- | \.\.
- | \.
- | \<\=
- | \<
- | \>\=
- | \>
- | \=\=
- | \~\=
- | \=
- | \,
- | \;
- | \:
- | \(
- | \)
- | \{
- | \}
- | \[
- | \]
+ | \+
+ | \-
+ | \#
+ | \*
+ | \/
+ | \%
+ | \^
+ | \.\.\.
+ | \.\.
+ | \.
+ | \<\=
+ | \<
+ | \>\=
+ | \>
+ | \=\=
+ | \~\=
+ | \=
+ | \,
+ | \;
+ | \:
+ | \(
+ | \)
+ | \{
+ | \}
+ | \[
+ | \]
}
=head1 AUTHOR
Modified: branches/pdd15oo/languages/pheme/lib/PhemeCompiler.pir
==============================================================================
--- branches/pdd15oo/languages/pheme/lib/PhemeCompiler.pir (original)
+++ branches/pdd15oo/languages/pheme/lib/PhemeCompiler.pir Fri Oct 5
20:03:13 2007
@@ -80,12 +80,11 @@
.param pmc source
.local pmc start_rule
- .local pmc newfrom
.local pmc match
start_rule = find_global 'Pheme::Grammar', 'prog'
- newfrom = find_global 'PGE::Match', 'newfrom'
- source = newfrom(source, 0, 'Pheme::Grammar')
+ $P0 = get_root_global ['parrot';'PGE'], 'Match'
+ source = $P0.'new'(source, 'grammar'=>'Pheme::Grammar')
match = start_rule( source )
.return( match )
Modified: branches/pdd15oo/languages/scheme/lib/Scheme.pm
==============================================================================
--- branches/pdd15oo/languages/scheme/lib/Scheme.pm (original)
+++ branches/pdd15oo/languages/scheme/lib/Scheme.pm Fri Oct 5 20:03:13 2007
@@ -1,5 +1,5 @@
# $Id$
-# Copyright (C) 2001-2006, The Perl Foundation.
+# Copyright (C) 2001-2007, The Perl Foundation.
package Scheme;
@@ -10,9 +10,9 @@
use Data::Dumper;
-use Scheme::Tokenizer();
-use Scheme::Parser();
-use Scheme::Generator();
+use Scheme::Tokenizer ();
+use Scheme::Parser ();
+use Scheme::Generator ();
use Scheme::Builtins;
=head1 SUBROUTINES
@@ -26,12 +26,13 @@
sub new {
my ( $class, $file ) = @_;
- bless { file => $file }, $class;
+ return bless { file => $file }, $class;
}
=head2 link_functions
-Generate PASM.
+Generate PIR.
+Make sure that the used functions end up in the PIR.
=cut
@@ -43,18 +44,18 @@
my @provides = keys %{ $main->{scope} };
my $code = $main->{code};
- my $header = << 'END_HEADER';
-# Header information
- # new_pad 0
+ my $header = <<'END_HEADER';
+# PIR generated by Scheme.
+
+ # used builtins:
END_HEADER
while (@missing) {
my $miss = shift @missing;
my $link = Scheme::Builtins->generate($miss);
- $header .= << "END";
- newsub P16, .Sub, ${miss}_ENTRY
- store_lex 0, "$miss", P16
+ $header .= <<"END";
+ # $miss
END
push @function, $miss;
Modified: branches/pdd15oo/languages/scheme/lib/Scheme/Builtins.pm
==============================================================================
--- branches/pdd15oo/languages/scheme/lib/Scheme/Builtins.pm (original)
+++ branches/pdd15oo/languages/scheme/lib/Scheme/Builtins.pm Fri Oct 5
20:03:13 2007
@@ -14,38 +14,41 @@
my %built_ins = (
write => [
[ '# Write function', '' ],
- [ 'write_ENTRY', 'typeof', 'I0', 'P5' ],
- [ '', 'ne', 'I0', '.Undef', 'write_N_UNDEF' ],
+ [ '', '.sub', 'write' ],
+ [ '', '.param pmc', 'arg1' ],
+ [ '', 'ne', 'I0', '.Undef', 'write_N_LAMBDA' ],
[ '', 'print', '"()"' ],
- [ '', 'branch', 'write_RET' ],
- [ 'write_N_UNDEF', 'ne', 'I0', '.Scratchpad', 'write_N_LAMBDA' ],
- [ '', 'print', '"lambda"' ],
- [ '', 'branch', 'write_RET' ],
+ [ '#', 'branch', 'write_RET' ],
+ [ '#write_N_UNDEF', 'ne', 'I0', '.Scratchpad', 'write_N_LAMBDA' ],
+ [ '#', 'print', '"lambda"' ],
+ [ '#', 'branch', 'write_RET' ],
[ 'write_N_LAMBDA', 'eq', 'I0', '.Array', 'write_ARRAY' ],
- [ '', 'print', 'P5' ],
- [ '', 'branch', 'write_RET' ],
- [ 'write_ARRAY', 'print', '"("' ],
- [ 'write_NEXT', 'set', 'P6', 'P5' ],
- [ '', 'set', 'P5', 'P6[0]' ],
- [ '', 'save', 'P6' ],
- [ '', 'save', 'P1' ],
- [ '', '.include', '"interpinfo.pasm"' ],
- [ '', 'interpinfo', 'P0', '.INTERPINFO_CURRENT_SUB' ],
- [ '', 'invokecc' ],
- [ '', 'restore', 'P1' ],
- [ '', 'restore', 'P6' ],
- [ '', 'set', 'P5', 'P6[1]' ],
- [ '', 'typeof', 'I0', 'P5' ],
- [ '', 'eq', 'I0', '.Undef', 'write_KET' ],
- [ '', 'ne', 'I0', '.Array', 'write_DOT' ],
- [ '', 'print', '" "' ],
- [ '', 'branch', 'write_NEXT' ],
- [ 'write_DOT', 'print', '" . "' ],
- [ '', 'save', 'P1' ],
- [ '', 'invokecc' ],
- [ '', 'restore', 'P1' ],
- [ 'write_KET', 'print', '")"' ],
- [ 'write_RET', 'returncc' ],
+ [ '', 'print', 'arg1' ],
+ [ 'write_ARRAY', '', '' ],
+ [ '', '.end' ],
+ [ '#', 'branch', 'write_RET' ],
+ [ '#write_ARRAY', 'print', '"("' ],
+ [ '#write_NEXT', 'set', 'P6', 'arg1' ],
+ [ '#', 'set', 'arg1', 'P6[0]' ],
+ [ '#', 'save', 'P6' ],
+ [ '#', 'save', 'P1' ],
+ [ '#', '.include', '"interpinfo.pasm"' ],
+ [ '#', 'interpinfo', 'P0', '.INTERPINFO_CURRENT_SUB' ],
+ [ '#', 'invokecc', 'P0' ],
+ [ '#', 'restore', 'P1' ],
+ [ '#', 'restore', 'P6' ],
+ [ '#', 'set', 'arg1', 'P6[1]' ],
+ [ '#', 'typeof', 'I0', 'arg1' ],
+ [ '#', 'eq', 'I0', '.Undef', 'write_KET' ],
+ [ '#', 'ne', 'I0', '.Array', 'write_DOT' ],
+ [ '#', 'print', '" "' ],
+ [ '#', 'branch', 'write_NEXT' ],
+ [ '#write_DOT', 'print', '" . "' ],
+ [ '#', 'save', 'P1' ],
+ [ '#', 'invokecc' ],
+ [ '#', 'restore', 'P1' ],
+ [ '#write_KET', 'print', '")"' ],
+ [ '#', '.end' ],
],
apply => [
['# Apply function'],
@@ -133,7 +136,7 @@
my $self = Scheme::Builtins->new();
- for ( @{ $built_ins{$name} } ) {
+ foreach ( @{ $built_ins{$name} } ) {
my ( $label, $op, @args ) = @{$_};
$self->_add_inst( $label, $op, [EMAIL PROTECTED] );
}
Modified: branches/pdd15oo/languages/scheme/lib/Scheme/Generator.pm
==============================================================================
--- branches/pdd15oo/languages/scheme/lib/Scheme/Generator.pm (original)
+++ branches/pdd15oo/languages/scheme/lib/Scheme/Generator.pm Fri Oct 5
20:03:13 2007
@@ -65,7 +65,7 @@
my %regs = %{ $self->{regs} };
for my $type ( keys %regs ) {
for my $count ( 0 .. 31 ) {
- $self->_add_inst( '', 'save', ["$type$count"] )
+ $self->_add_inst( '#', 'save', ["$type$count"] )
if $regs{$type}->{$count};
}
}
@@ -107,7 +107,7 @@
for my $type ( reverse keys %regs ) {
for ( my $count = 31 ; $count >= 0 ; $count-- ) {
- $self->_add_inst( '', 'restore', ["$type$count"] )
+ $self->_add_inst( '#', 'restore', ["$type$count"] )
if $regs{$type}->{$count};
}
}
@@ -149,6 +149,15 @@
return $return;
}
+sub _find_name {
+ my ( $self, $symbol ) = @_;
+
+ my $return = $self->_save_1('P');
+ $self->_add_inst( '', 'find_name', [ $return, qq{"$symbol"} ] );
+
+ return $return;
+}
+
sub _store_lex {
my ( $self, $symbol, $value ) = @_;
@@ -2009,7 +2018,7 @@
my $self = shift;
my $symbol = shift;
- my $func_obj = $self->_find_lex($symbol);
+ my $func_obj = $self->_find_name($symbol);
my $scope = $self->{scope};
@@ -2037,6 +2046,7 @@
my $count = 5;
my $empty = $return;
+ my @args;
while ( my $arg = shift ) {
if ( $arg ne "P$count" ) {
if ( $arg =~ /^[INS]/ ) {
@@ -2054,18 +2064,17 @@
}
}
if ($moved) {
- $self->_add_inst( '', 'set', [ $empty, "P$count" ] );
+ push @args, $count;
$empty = $moved;
}
$self->_add_inst( '', 'set', [ "P$count", $arg ] );
+ push @args, $count;
}
$count++;
}
- $self->_add_inst( '', 'set', [ 'P0', $func_obj ] ) unless $func_obj eq
'P0';
- $self->_add_inst( '', 'set', [ 'I0', 0 ] ); # Pass all args in
Px registers
- $self->_add_inst( '', 'set', [ 'I3', $count - 5 ] ); # Tell about
number of registers
- $self->_add_inst( '', 'invokecc' );
+ $self->_add_inst( '', 'set_args', [ q{"} . join( q{,}, q{0} x
scalar(@args) ) . q{"}, join( q{,}, map { "P$_" } @args ) ] );
+ $self->_add_inst( '', 'invokecc', [ $func_obj ] );
$self->_add_inst( '', 'set', [ $return, 'P5' ] ) unless $return eq 'P5';
$self->_restore_set;
@@ -2184,6 +2193,7 @@
$self->_add_inst( '', '.end' );
+ # die Dumper( $self );
$self->_format_columns();
# not need any more
Modified: branches/pdd15oo/languages/scheme/t/logic/basic.t
==============================================================================
--- branches/pdd15oo/languages/scheme/t/logic/basic.t (original)
+++ branches/pdd15oo/languages/scheme/t/logic/basic.t Fri Oct 5 20:03:13 2007
@@ -8,23 +8,28 @@
use FindBin;
use lib "$FindBin::Bin/../../lib";
-#use Test::More tests => 7;
-use Test::More skip_all => 'Using obsolete calling conventions';
+use Test::More tests => 7;
+
use Parrot::Test;
###
### If
###
-output_is( <<'CODE', 1, 'basic if - Fail' );
+language_output_is( 'Scheme', <<'CODE', 1, 'basic if - Fail' );
(write (if (= 1 1) 1 0))
CODE
-output_is( <<'CODE', 1, 'basic if - Pass' );
+
+SKIP:
+{
+ skip( "adaption to calling converions is underway", 6 );
+
+language_output_is( 'Scheme', <<'CODE', 1, 'basic if - Pass' );
(write (if (= 0 1) 0 1))
CODE
-output_is( <<'CODE', 7, 'slightly more complex if' );
+language_output_is( 'Scheme', <<'CODE', 7, 'slightly more complex if' );
(write (if (= 9 9) 7 -23))
CODE
@@ -32,11 +37,11 @@
### And
###
-output_is( <<'CODE', 1, 'basic and - Pass' );
+language_output_is( 'Scheme', <<'CODE', 1, 'basic and - Pass' );
(write (and 1 1))
CODE
-output_is( <<'CODE', 0, 'basic and - Fail' );
+language_output_is( 'Scheme', <<'CODE', 0, 'basic and - Fail' );
(write (and 0 1))
CODE
@@ -44,14 +49,16 @@
### Or
###
-output_is( <<'CODE', 1, 'basic or - Pass' );
+language_output_is( 'Scheme', <<'CODE', 1, 'basic or - Pass' );
(write (or 1 1))
CODE
-output_is( <<'CODE', 0, 'basic or - Fail' );
+language_output_is( 'Scheme', <<'CODE', 0, 'basic or - Fail' );
(write (or 0 0))
CODE
+}
+
# Local Variables:
# mode: cperl
Modified: branches/pdd15oo/src/pmc/class.pmc
==============================================================================
--- branches/pdd15oo/src/pmc/class.pmc (original)
+++ branches/pdd15oo/src/pmc/class.pmc Fri Oct 5 20:03:13 2007
@@ -166,7 +166,7 @@
type = VTABLE_get_integer(interp, type_pmc);
if (type > enum_type_undef) {
- /* TODO get printable name */
+ /* RT#46091 get printable name */
real_exception(interp, NULL, INVALID_OPERATION,
"Class %Ss already registered!\n",
VTABLE_get_string(interp, name));
@@ -687,7 +687,7 @@
/* If we've been instantiated already, need a new class. */
if (_class->instantiated) {
- /* XXX Unimplemented! */
+ /* RT#46093 Unimplemented! */
real_exception(interp, NULL, E_NotImplementedError,
"Modifications to already instantiated classes not allowed
yet.");
}
@@ -723,7 +723,7 @@
/* If we have already added a method with this name... */
if (VTABLE_exists_keyed_str(interp, _class->methods, name)) {
- /* XXX Need to handle multi methods here. */
+ /* RT46095 Need to handle multi methods here. */
real_exception(interp, NULL, E_NotImplementedError,
"A method of this name already exists. It may have been
supplied by a role.");
}
@@ -761,6 +761,9 @@
break;
}
}
+
+ string_cstring_free(c_name);
+
if (!found)
real_exception(interp, NULL, METH_NOT_FOUND,
"'%S' is not a valid vtable function name.", name);
@@ -783,7 +786,7 @@
/* If we've been instantiated already, need a new class. */
if (_class->instantiated) {
- /* XXX Unimplemented! */
+ /* RT46097 Unimplemented! */
real_exception(interp, NULL, E_NotImplementedError,
"Modifications to already instantiated classes not allowed
yet.");
return;
@@ -795,7 +798,7 @@
return;
}
- /* XXX Check we don't already have this parent. */
+ /* RT46099 Check we don't already have this parent. */
/* Add to the lists of our immediate parents and all parents. */
VTABLE_push_pmc(interp, _class->parents, parent);
@@ -1052,7 +1055,7 @@
}
/* Build full parents list.
- * XXX Need pluggable MRO, for now always do C3. */
+ * RT#46101 Need pluggable MRO, for now always do C3. */
_class->all_parents = Parrot_ComputeMRO_C3(interp, SELF);
if (!CLASS_is_anon_TEST(SELF))
interp->vtables[VTABLE_type(interp, SELF)]->mro =
_class->all_parents;
Modified: branches/pdd15oo/src/pmc/parrotio.pmc
==============================================================================
--- branches/pdd15oo/src/pmc/parrotio.pmc (original)
+++ branches/pdd15oo/src/pmc/parrotio.pmc Fri Oct 5 20:03:13 2007
@@ -67,23 +67,24 @@
string_cstring_free(c_file);
string_cstring_free(c_mode);
- string_cstring_free(c_layer);
- if (!pio || !PMC_struct_val(pio))
+ if (!pio || !PMC_struct_val(pio)) {
+ string_cstring_free(c_layer);
return pmc_new(INTERP, enum_class_Undef);
+ }
if (l) {
ParrotIO * const io = (ParrotIO *)PMC_data(pio);
const int is_mmap = strcmp(c_layer, "mmap") == 0;
- /* XXX move this into the layer */
+ /* RT#46079 move this into the layer */
if ((is_mmap && (io->b.flags & PIO_BF_MMAP)) || !is_mmap) {
l = interp->piodata->default_stack;
if (strcmp(l->name, "buf") == 0)
l = l->down;
- /* XXX layer is stored twice - which is used when */
+ /* RT#46081 layer is stored twice - which is used when */
io->stack = l;
PMC_struct_val(pio) = l;
@@ -97,7 +98,9 @@
}
}
- /* XXX leaks as in ops/io.ops: open */
+ /* RT#46083 leaks as in ops/io.ops: open */
+ string_cstring_free(c_layer);
+
return pio;
}
@@ -282,7 +285,7 @@
string_cstring_free(path);
- /* TODO handle stdin */
+ /* RT#46085 handle stdin */
result = PIO_reads(INTERP, pio, size);
PIO_close(INTERP, pio);
return result;
@@ -325,11 +328,11 @@
=item C<METHOD INTVAL setbuf(INTVAL)>
-XXX TBD
+RT#46087 TBD
=item C<METHOD INTVAL setlinebuf()>
-XXX TBD
+RT#46089 TBD
=cut