Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
fix with respect to ops_massacre parrot branch
Browse files Browse the repository at this point in the history
  • Loading branch information
plobsing committed May 27, 2010
1 parent eaa4deb commit f60fcfe
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 26 deletions.
8 changes: 4 additions & 4 deletions src/HLL/Compiler.pm
Expand Up @@ -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);
Expand All @@ -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;
Expand Down
14 changes: 8 additions & 6 deletions src/Regex/Cursor.pir
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions src/setting/IO.pm
Expand Up @@ -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;
}
Expand All @@ -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
17 changes: 11 additions & 6 deletions src/stage0/HLL-s0.pir
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
14 changes: 8 additions & 6 deletions src/stage0/Regex-s0.pir
Expand Up @@ -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
Expand Down

0 comments on commit f60fcfe

Please sign in to comment.