Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Using low-level parse to speed up things
Thanks to @ugexe and @taboege for hints on how to make this. I've
checked memory, and it's actually taking quite a bit of memory, but
not as much as EVAL and it's actually faster than that.

It's also producing a false positive with `class
Metamodel::ParametricRoleHOW` which I don't know how to fix.

Refs #2764 but leaves it open until

* Memory usage has actually been addressed, and
* We manage to fix that false positive
  • Loading branch information
JJ committed May 17, 2019
1 parent 7bc42b8 commit d51503b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 0 additions & 1 deletion doc/Language/exceptions.pod6
Expand Up @@ -392,7 +392,6 @@ converted to a normal exception.
=begin code
{ return; CATCH { default { $*ERR.say: .^name, ': ',.Str } } }
# OUTPUT: «X::ControlFlow::Return: Attempt to return outside of any Routine␤»
# was CX::Return
=end code
Expand Down
20 changes: 11 additions & 9 deletions xt/examples-compilation.t
Expand Up @@ -133,21 +133,23 @@ sub check-chunk( $eg ) {
my $has-error;
{
# Does the test require its own file?
# if $eg<solo> {
if $eg<solo> {
my ($tmp_fname, $tmp_io) = tempfile;
$tmp_io.spurt: $code, :close;
my $proc = Proc::Async.new($*EXECUTABLE, '-c', $tmp_fname);
$proc.stdout.tap: {;};
$proc.stderr.tap: {;};
$has-error = ! await $proc.start;
# } else {
# temp $*OUT = open :w, $*SPEC.devnull;
# temp $*ERR = open :w, $*SPEC.devnull;
# try EVAL $code;
# $has-error = $!;
# close $*OUT;
# close $*ERR;
# }
} else {
temp $*OUT = open :w, $*SPEC.devnull;
temp $*ERR = open :w, $*SPEC.devnull;
use nqp;
my $*LINEPOSCACHE;
$has-error = not try { nqp::getcomp('perl6').parse($code) };
close $*OUT;
close $*ERR;

}
}

todo(1) if $eg<todo>;
Expand Down

0 comments on commit d51503b

Please sign in to comment.