Skip to content

Lexical lookup from quasis, part Ⅰ #474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 20, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Restore .detach to working order
I have a feeling this method will need its own mechanism once we
get to actually remembering which block variables outside of a quasi
come from. For now, this works.

This empties out the quarantined tests file, and so we pass all the
tests we used to, and then some.
  • Loading branch information
Carl Masak committed Feb 19, 2019

Unverified

No user is associated with the committer email.
commit ab28ef489f9db3448f67c17e7f9ebf448873d25c
4 changes: 2 additions & 2 deletions lib/_007/Runtime.pm6
Original file line number Diff line number Diff line change
@@ -275,8 +275,8 @@ class _007::Runtime {
return $thing
if $thing ~~ Val;

return $thing.new(:name($thing.name))
if $thing ~~ Q::Identifier;
return Q::Term::Identifier.new(:name($thing.name))
if $thing ~~ Q::Term::Identifier;

return $thing
if $thing ~~ Q::Unquote;
32 changes: 0 additions & 32 deletions quarantined-tests.t.fixme

This file was deleted.

25 changes: 25 additions & 0 deletions t/builtins/methods.t
Original file line number Diff line number Diff line change
@@ -222,6 +222,31 @@ use _007::Test;
outputs $program, qq!["1", "2", "3"]\n[1, 2, 3]\n!, "flatMap() does nothing if there's no array to remove";
}

{
my $program = q:to/./;
macro so_hygienic() {
my x = "yay, clean!";
return quasi {
say(x);
};
}

macro so_unhygienic() {
my x = "something is implemented wrong";
return quasi {
say(x)
}.detach();
}

my x = "that's gross!";
so_hygienic(); # yay, clean!
so_unhygienic(); # that's gross!
.

outputs $program, "yay, clean!\nthat's gross!\n",
"detaching a qtree makes its identifiers unhygienic (#62)";
}

{
my $program = q:to/./;
my a = [1, 2];