-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Introduce support for Mod.{A, B, C} on imports, alias, require and use #3666
Conversation
@@ -405,8 +406,16 @@ dot_op -> '.' eol : '$1'. | |||
dot_identifier -> identifier : '$1'. | |||
dot_identifier -> matched_expr dot_op identifier : build_dot('$2', '$1', '$3'). | |||
|
|||
dot_alias -> aliases : {'__aliases__', meta_from_token('$1', 0), ?exprs('$1')}. | |||
dot_alias -> matched_expr dot_op aliases : build_dot_alias('$2', '$1', '$3'). | |||
dot_plain_alias -> aliases : {'__aliases__', meta_from_token('$1', 0), ?exprs('$1')}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to change the parser, I have found this old commit, we just need to bring it back:
Except I wouldn't bring []
, although we can bring both {}
and <<>>
. The reason we shouldn't bring []
it is because we don't have :[]
in AST anyway.
ce1f700
to
aff2bb3
Compare
expand_multi_alias_call(Kind, Meta, Base, Refs, E); | ||
true -> | ||
compile_error(Meta, ?m(E, file), | ||
"options is not supported by multi-alias") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do support options... we don't support :as
.
ff058a6
to
b24e029
Compare
bbc0af9
to
9efc109
Compare
Updated. |
raise ArgumentError, "invalid arguments for use, expected an atom or alias as argument" | ||
end | ||
|
||
case module do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try moving the case to a separate function that returns a list. Then you can just do: Enum.map parse_aliases(module, __CALLER__), fun
with unquote_splicing at the end.
c6e2cce
to
1df23e7
Compare
Beautiful. It will be in 1.2. :) |
1df23e7
to
8c57c91
Compare
Introduce support for Mod.{A, B, C} on imports, alias, require and use
o/ \o |
This is going to be awesome! |
Awesome! This is great news, thanks so much! Also do you guys (@knewter @paulcsmith and @lexmag) share the same photographer? ;) |
@mschae Haha I hadn't noticed that! Maybe we do! |
Ha, mine came from a headshot at OSCon 2014...anticipating responses :) /cc @paulcsmith @lexmag |
@knewter Got mine when I joined the company I'm working for :) |
Hehe, homemade for visa application about 2 years ago. |
Includes the ability to quote multiple aliases, but no references yet. Ports elixir-lang/elixir#3666.
Includes the ability to quote multiple aliases, but no references yet. Ports elixir-lang/elixir#3666.
Closes #3646.
elixir_parser
to emit new ASTalias
multiline:
just random place:
invalid identifier:
import
require
use
There are a couple of open questions:
macro List.{Chars,}
macro List.{}
@josevalim, I would like any feedback on it.