José Valim
91c09e02d5
Attempt to soft_purge modules, closes #7047
2017-11-21 13:57:52 -02:00
jgmchan
6ae232efd5
Show better error if an anonymous function has default arguments
2017-11-16 13:53:28 -02:00
Glauber Campinho
ed9c9b1601
Remove dialyzer warnings from else in with clauses ( #7031 )
...
Add generated: true to guard clauses from else in with clauses
Resolves #6426
2017-11-15 20:53:57 +01:00
Glauber Campinho
fe47af5075
Warn duplicate definitions in macros ( #7037 )
...
Closes #6637
2017-11-15 20:52:28 +01:00
Eric Meadows-Jönsson
87bf050e2c
Fix precedence of bitwise XOR (^^^) in formatter ( #7036 )
...
Closes #7034 .
2017-11-15 19:53:20 +01:00
José Valim
b0e79fa76e
Document and use new uniq: true flag when appropriate
2017-11-13 23:23:55 +01:00
Glauber Campinho
673fddf40c
Support uniq: true in for comprehensions ( #7020 )
2017-11-13 23:00:53 +01:00
José Valim
19925025a8
Add notes and TODOs to variable handling
2017-11-09 18:08:08 +01:00
Michał Muskała
bd63552fe0
Move andalso and orelse expansion to the erl pass ( #7015 )
...
Since they modify the AST the correct place for the transformation is not the
macro expansion like today, but rather the erlang pass.
A note for people running git blame:
This transformation was done in the first place to correct the error that is
raised by `erlang:andalso/2` and `erlang:orelse/2` in case the first argument
is not a boolean. The rewrite changes it from `:badarg` into
`{:badbool, op, value}`. The inlining of both functions into a case would be
done anyway in the erlang compiler.
2017-11-09 14:24:48 +01:00
José Valim
9c95ee96b3
Consider comments inside function calls
...
Closes #6994
2017-11-07 10:50:11 +01:00
José Valim
f97900cd37
Raise on reserved tokens, closes #6532
2017-11-06 17:15:44 +01:00
José Valim
6a5f96b5ac
Properly guard bare_warn to catch errors early
2017-11-03 19:53:30 +01:00
José Valim
f15d47f8e2
Pass line and file to IO.warn whenever possible
2017-11-03 18:49:07 +01:00
José Valim
10bc690a70
Add Kernel.ParallelCompiler.async/1
...
This gives developers more control over the parallel compiler
and allows a single file to compile multiple modules in parallel
by spawning tasks.
2017-11-02 17:30:32 +01:00
Michał Muskała
9e079d30b7
Separate tracking structs from compile-time dependencies
...
This is a first step to limiting recompilations in case a struct is used in a
module, the "parent module" of the struct changes, but struct definition itself
does not change.
Signed-off-by: José Valim <jose.valim@plataformatec.com.br >
2017-10-31 14:24:48 +01:00
José Valim
ef43b25f85
Restrict next break fits and eols on operators and function calls
...
* Whitelist which operators support next_break_fits
* No longer consider tuples as part of next_break_fits
* Do not consider eol for = and ::
* Do not consider eol for calls with one next_break_fits arg
2017-10-27 12:34:09 +02:00
José Valim
e26128a630
Discard malformed lines in metadata
...
Closes #6980 .
2017-10-27 00:47:09 +02:00
Blake Tan
39d903ecf3
Better handling of non existing atoms ( #6978 )
2017-10-26 20:25:00 +02:00
José Valim
f0a74482da
Respect the user's choice on calls
...
Closes #6977
2017-10-26 13:19:21 +02:00
José Valim
3fba28e0ee
Treat => and : as operators in the formatter
...
This means that the right side will break on its own line
when it doesn't fit and be indented by two spaces.
Closes #6976 .
2017-10-26 12:43:02 +02:00
José Valim
a815313750
Store the number of defaults in the definition Meta
2017-10-26 00:18:06 +02:00
José Valim
703e3000a6
Remove end column information from tokens
...
If we want to store this information, we need to store it
alongside the end line, otherwise it is ambiguous.
2017-10-25 11:56:31 +02:00
José Valim
292a14466d
Support columns: true in string_to_quoted, closes #3554
2017-10-25 11:02:53 +02:00
José Valim
47ca7004b6
Avoid conflicts with erl_anno in meta
...
We avoid using :file publicly as well as :location privately.
We do still use :file privately but that's supposed to mirror
the `-file` annotation in Erlang before function definitions.
2017-10-25 00:33:05 +02:00
José Valim
df8bca004a
Improve optional callback checks
2017-10-22 01:48:00 +02:00
José Valim
aad66f22bc
Move all remaining behaviour usage warnings to Elixir
2017-10-22 00:59:11 +02:00
Alexis Brodeur
18f723541c
Perform some behaviour lint checks in Elixir ( #6841 )
2017-10-21 23:35:15 +02:00
José Valim
f130cb9c84
Improve warnings during expansion
2017-10-21 20:43:35 +02:00
Glauber Campinho
f3acc14fb5
Add file information to the dispatches on the source manifests ( #6954 )
2017-10-21 11:53:06 +02:00
José Valim
115bb08f51
Deprecate Range.range? in favor of pattern matching
2017-10-17 19:54:03 +02:00
Andrea Leopardi
b5211deec0
Fix a bug where we discarded some meta in some literals in the parser ( #6946 )
...
Closes #6945 .
2017-10-17 17:31:48 +02:00
José Valim
01cd27393e
Keep integer/float underscores in the formatter, closes #6931
2017-10-16 16:44:53 +02:00
José Valim
d475c8c286
Do not pass :in_memory to load_binary
...
Erlang's typespecs define only cover_compiled and preloaded
as valid atoms and uses an empty list for generated code.
So we should follow Erlang's rules until we can officially
relax them.
2017-10-14 23:19:32 +02:00
José Valim
782a4a59c3
Formatter should not fail on empty clauses, closes #6924
2017-10-12 11:30:41 +02:00
José Valim
a33cbcd32a
Format errors_test.exs
2017-10-12 09:35:58 +02:00
José Valim
566db02f73
Preserve escaped new lines in formatter, closes #6861
2017-10-11 13:18:49 +02:00
José Valim
06bda15736
Do not add parens for var.field before do/end blocks
2017-10-10 16:13:10 +02:00
José Valim
bf3fa2646a
Do not apply next_break_fits if eol is present
2017-10-09 23:55:49 +02:00
José Valim
88b6e54671
Properly render :-> as an atom
2017-10-09 22:55:07 +02:00
José Valim
21e44bdb09
Keep the user's choice on non-module remote calls with no args
2017-10-09 22:43:08 +02:00
José Valim
541f56d950
When when and | also respect new lines
2017-10-09 17:13:39 +02:00
José Valim
8e5d31d875
Only keep locals_without_parens if they never had parens to start with
2017-10-09 15:57:57 +02:00
José Valim
4a5be87fca
Store specs/callbacks in the order they are defined
2017-10-09 11:08:52 +02:00
José Valim
5bd91a4cb3
Warn on trailing commas in calls
2017-10-09 10:43:10 +02:00
José Valim
3335c73847
Also preserve user newlines if trailing commas exist
2017-10-09 09:17:35 +02:00
José Valim
e61c6e00c8
More improvements to the formatter grammar, docs, and locals without bindings
2017-10-08 19:28:36 +02:00
José Valim
f311882ed8
Check formatting is equivalent on travis
2017-10-08 19:28:36 +02:00
José Valim
74d0efe313
Do not raise on clauses with newlines before and after ->
2017-10-07 10:13:53 +02:00
José Valim
d5f3ec2e96
Add end_lines to do/end blocks and represent empty ones with empty blocks
2017-10-07 09:50:17 +02:00
José Valim
75fc03ace7
Add more metadata to containers
2017-10-07 00:18:22 +02:00