Skip to content
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

Added support for replacing args in other expressions than calls #9

Merged
merged 5 commits into from
Nov 19, 2019

Conversation

FNj
Copy link
Contributor

@FNj FNj commented Oct 12, 2018

Obvious from added tests:

@test macroexpand( :(@pipe a |> _)) == :(a) #Identity works
@test macroexpand( :(@pipe a |> _[b])) == :(a[b]) #Indexing works

Which means this works:

@pipe 42 |> _ # produces 42
@pipe ["first", "last"] |> _[2] # produces "last"

@FNj
Copy link
Contributor Author

FNj commented Oct 12, 2018

I also ended up effectively adding support for piping into macros and blocks by removing Expr.head checking in the rewrite(ff::Expr,target) method.

@FNj FNj changed the title Added support for indexing and identity Added support for replacing args in other expressions than calls Oct 12, 2018
REQUIRE Outdated
@@ -1 +1,2 @@
julia 0.3
julia 1.0
Test
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete the Test from REQUIRE, see #10.

@oxinabox
Copy link
Owner

oxinabox commented Oct 14, 2018

Hi, thanks for this, seems like a good idea.

can you rebase this PR.
And use _macroexpand rather than macroexpand.

@FNj
Copy link
Contributor Author

FNj commented Oct 14, 2018

Everything should be fine now. Also I basically hard forked this because I wanted a slightly different behaviour.

@oxinabox
Copy link
Owner

Oh sorry, I forgot about this PR.

@oxinabox
Copy link
Owner

LGTM

@oxinabox oxinabox merged commit f91b1af into oxinabox:master Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants