Skip to content

Commit

Permalink
RakuAST: don't absolutify file names of compunit
Browse files Browse the repository at this point in the history
Several spectests expect file names in backtraces to be relative.
  • Loading branch information
niner committed May 1, 2024
1 parent b50fb0c commit 1278c5b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions src/Raku/ast/origins.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ class RakuAST::Origin::Source {
if nqp::isnull($file := nqp::getlexdyn('$?FILES')) {
$file := '<unknown file>';
}
elsif !nqp::eqat($file,'/',0) && !nqp::eqat($file,'-',0) && !nqp::eqat($file,':',1) {
$file := nqp::cwd ~ '/' ~ $file;
}
}
nqp::bindattr($obj, RakuAST::Origin::Source, '$!line-file', nqp::list(nqp::list(0, 0, $file)));
$obj.SETUP-LINE-POSITIONS();
Expand Down
2 changes: 1 addition & 1 deletion t/12-rakuast/var.rakutest
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sub ast(RakuAST::Node:D $node --> Nil) {

# MUST be the first test to handle EVAL_n counter
subtest 'Special compiler variable $?FILE' => {
my $file := $*CWD.absolute ~ '/EVAL_1';
my $file := 'EVAL_1';
# $?FILE
ast RakuAST::Var::Compiler::File.new($file);

Expand Down

0 comments on commit 1278c5b

Please sign in to comment.