Permalink
Browse files

fix with respect to ops_massacre parrot branch

  • Loading branch information...
1 parent eaa4deb commit f60fcfe701c1c024faf49cf134041d3a3a3be9ba @plobsing plobsing committed May 27, 2010
Showing with 37 additions and 26 deletions.
  1. +4 −4 src/HLL/Compiler.pm
  2. +8 −6 src/Regex/Cursor.pir
  3. +6 −4 src/setting/IO.pm
  4. +11 −6 src/stage0/HLL-s0.pir
  5. +8 −6 src/stage0/Regex-s0.pir
View
@@ -84,15 +84,15 @@ class HLL::Compiler is PCT::HLLCompiler {
method autoprint($value) {
pir::say(~$value)
- unless pir::tell__IP(pir::getstdout__P()) > $*AUTOPRINTPOS;
+ unless (pir::getinterp__P()).stdhandle(1).tell() > $*AUTOPRINTPOS;
}
method interactive(*%adverbs) {
my $target := pir::downcase(%adverbs<target>);
- pir::printerr__vS(self.commandline_banner);
+ pir::print__vPS( pir::getinterp__P().stdhandle(2), self.commandline_banner );
- my $stdin := pir::getstdin__P();
+ my $stdin := pir::getinterp__P().stdhandle(0);
my $encoding := ~%adverbs<encoding>;
if $encoding && $encoding ne 'fixed_8' {
$stdin.encoding($encoding);
@@ -107,7 +107,7 @@ class HLL::Compiler is PCT::HLLCompiler {
last if pir::isnull($code);
# Set the current position of stdout for autoprinting control
- my $*AUTOPRINTPOS := pir::tell__IP(pir::getstdout__P());
+ my $*AUTOPRINTPOS := (pir::getinterp__P()).stdhandle(1).tell();
our $interactive_ctx;
our %interactive_pad;
my $*CTXSAVE := self;
View
@@ -409,13 +409,15 @@ Log a debug message.
orig = getattribute self, '$!target'
line = orig.'lineof'(from)
inc line
- printerr from
- printerr '/'
- printerr line
- printerr ': '
+ $P0 = getinterp
+ $P1 = $P0.'stdhandle'(2)
+ print $P1, from
+ print $P1, '/'
+ print $P1, line
+ print $P1, ': '
$S0 = join '', args
- printerr $S0
- printerr "\n"
+ print $P1, $S0
+ print $P1, "\n"
done:
.return (self)
.end
View
@@ -11,9 +11,10 @@ Returns the contents of C<$filename> as a single string.
=end
our sub slurp ($filename) {
- my $handle := pir::open__Pss($file, 'r');
+ my $handle := FileHandle.new();
+ $handle.open($file, 'r');
my $contents := $handle.readall;
- pir::close($handle);
+ $handle.close();
$contents;
}
@@ -23,9 +24,10 @@ Write the string value of C<$contents> to C<$filename>.
=end item
our sub spew($filename, $contents) {
- my $handle := pir::open__Pss($filename, 'w');
+ my $handle := FileHandle.new();
+ $handle.open($filename, 'w');
$handle.print($contents);
- pir::close($handle);
+ $handle.close();
}
# vim: ft=perl6
View
@@ -7278,8 +7278,9 @@ An operator precedence parser.
.lex "self", self
.lex "$value", param_286
.annotate 'line', 87
- getstdout $P289
- tell $I290, $P289
+ $P0 = getinterp
+ $P289 = $P0.'stdhandle'(1)
+ $I290 = $P289.'tell'()
set $N291, $I290
find_dynamic_lex $P292, "$*AUTOPRINTPOS"
unless_null $P292, vivify_56
@@ -7348,9 +7349,12 @@ An operator precedence parser.
.annotate 'line', 93
find_lex $P310, "self"
$S311 = $P310."commandline_banner"()
- printerr $S311
+ $P0 = getinterp
+ $P1 = $P0.'stdhandle'(2)
+ print $P1, $S311
.annotate 'line', 95
- getstdin $P312
+ $P0 = getinterp
+ $P312 = $P0.'stdhandle'(0)
store_lex "$stdin", $P312
.annotate 'line', 96
find_lex $P313, "%adverbs"
@@ -7465,8 +7469,9 @@ An operator precedence parser.
throw $P348
if_345_end:
.annotate 'line', 110
- getstdout $P349
- tell $I350, $P349
+ $P0 = getinterp
+ $P349 = $P0.'stdhandle'(1)
+ $I350 = $P349.'tell'()
new $P351, 'Integer'
set $P351, $I350
store_lex "$*AUTOPRINTPOS", $P351
View
@@ -429,13 +429,15 @@ Log a debug message.
orig = getattribute self, '$!target'
line = orig.'lineof'(from)
inc line
- printerr from
- printerr '/'
- printerr line
- printerr ': '
+ $P0 = getinterp
+ $P1 = $P0.'stdhandle'(2)
+ print $P1, from
+ print $P1, '/'
+ print $P1, line
+ print $P1, ': '
$S0 = join '', args
- printerr $S0
- printerr "\n"
+ print $P1, $S0
+ print $P1, "\n"
done:
.return (self)
.end

0 comments on commit f60fcfe

Please sign in to comment.