José Valim
4175ddebd9
Do not allow stabs mixed with expressions
2018-01-16 12:23:12 +01:00
José Valim
b9591267dc
Replace Code.load_file/2 by Code.compile_file/2 ( #7201 )
...
Currently there is no way to compile a file without leaving
footprints on the system. Plus, the term load_file/2 is very
confusing as loaded is the notation used by modules.
This commit focuses the whole loaded aspect of files exclusively
on require_file/2 (and renames two functions accordingly) and
introduces compile_file/2 which is semantically simpler than
load_file/2.
2018-01-13 22:04:22 +01:00
José Valim
8ece3b9748
Fix precedence of & in regards to =, closes #7188
2018-01-09 14:13:45 +01:00
Andrea Leopardi
8c05bb078d
Fix a typo in a heredoc-related warning
...
[ci skip]
2018-01-08 14:23:39 +01:00
José Valim
f34d74913c
Warn if heredoc is outdented, closes #7174
2018-01-07 17:46:42 +01:00
José Valim
f518f20372
Revert "Attempt to soft_purge modules, closes #7047 "
...
Soft purging modules was badfun/badarg errors when
invoking left over anonymous functions.
2018-01-05 17:22:20 +01:00
José Valim
889ae9afbb
Do not leak variables during optimizations, closes #7161
2018-01-01 12:04:15 +01:00
Donald Little
b74de02190
Return right side expression value on struct matching ( #7160 )
2017-12-30 18:35:40 +01:00
Andrea Leopardi
48e914dd3a
Hard-deprecate some things for 1.7 ( #7139 )
2017-12-24 21:32:56 +01:00
José Valim
9e1485f29a
Start v1.7
2017-12-23 19:40:30 +01:00
José Valim
3010cd3dc1
Provide better error messages for contextual operators
...
Such as | and ::
Closes #6835
2017-12-23 10:27:28 +01:00
José Valim
f6a017dbc3
Add missing ;
2017-12-19 14:40:52 +01:00
José Valim
695915b586
Read the deprecated chunk directly as a list
2017-12-19 12:18:12 +01:00
Glauber Campinho
1d58413053
Introduce @deprecated ( #7113 )
2017-12-19 11:44:35 +01:00
Glauber Campinho
b99306bb44
Remove multiple clauses warning for default values on bodiless clause ( #7092 )
2017-12-11 21:38:49 +01:00
José Valim
4d3cbcdaaa
Introduce @since as non-warning definition annotation
...
Partially implements #7099 .
2017-12-11 18:22:08 +01:00
José Valim
74f617399f
Use a single table instead of digraph for tracking locals
...
This reduces the number of spawned ETS tables from 3 to 1
per local tracker and also removes the need for a separate
process.
Closes #7091 .
2017-12-06 19:49:54 +01:00
Glauber Campinho
25dc8d8d4f
Move boolean checks optimizations to Kernel ( #7071 )
2017-11-30 00:29:54 -02:00
Glauber Campinho
e12a76eca9
Translate clauses for boolean check ( #7069 )
...
Warnings for unsafe variable on boolean checks stopped working after #7015 because
variables of the right clause are unbound on the left clause.
Fixes #7044
2017-11-28 11:56:13 -02:00
José Valim
6915de35a6
Attempt to soft_purge modules, closes #7047
2017-11-21 13:57:52 -02:00
jgmchan
882c2bdb24
Show better error if an anonymous function has default arguments
2017-11-16 13:53:28 -02:00
Glauber Campinho
96fcc7e2cc
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
9aeafeefbd
Warn duplicate definitions in macros ( #7037 )
...
Closes #6637
2017-11-15 20:52:28 +01:00
Eric Meadows-Jönsson
1303d09f61
Fix precedence of bitwise XOR (^^^) in formatter ( #7036 )
...
Closes #7034 .
2017-11-15 19:53:20 +01:00
José Valim
d0e9fd38f8
Document and use new uniq: true flag when appropriate
2017-11-13 23:23:55 +01:00
Glauber Campinho
505c10e474
Support uniq: true in for comprehensions ( #7020 )
2017-11-13 23:00:53 +01:00
José Valim
1fd0f1d81c
Add notes and TODOs to variable handling
2017-11-09 18:08:08 +01:00
Michał Muskała
c6772ee2c8
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
5ea7321562
Consider comments inside function calls
...
Closes #6994
2017-11-07 10:50:11 +01:00
José Valim
ad190b0889
Raise on reserved tokens, closes #6532
2017-11-06 17:15:44 +01:00
José Valim
3e72f808ed
Properly guard bare_warn to catch errors early
2017-11-03 19:53:30 +01:00
José Valim
b4c8e86c5f
Pass line and file to IO.warn whenever possible
2017-11-03 18:49:07 +01:00
José Valim
4f935aa942
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
c95a877d38
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
794928efe1
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
ba19fc8e50
Discard malformed lines in metadata
...
Closes #6980 .
2017-10-27 00:47:09 +02:00
Blake Tan
554d595009
Better handling of non existing atoms ( #6978 )
2017-10-26 20:25:00 +02:00
José Valim
3d84aec0f9
Respect the user's choice on calls
...
Closes #6977
2017-10-26 13:19:21 +02:00
José Valim
7f8136915f
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
823957b677
Store the number of defaults in the definition Meta
2017-10-26 00:18:06 +02:00
José Valim
d3a85bfd21
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
b87989e702
Support columns: true in string_to_quoted, closes #3554
2017-10-25 11:02:53 +02:00
José Valim
4b930b0a0b
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
ef3494ae68
Improve optional callback checks
2017-10-22 01:48:00 +02:00
José Valim
41bc3616d9
Move all remaining behaviour usage warnings to Elixir
2017-10-22 00:59:11 +02:00
Alexis Brodeur
0194bad846
Perform some behaviour lint checks in Elixir ( #6841 )
2017-10-21 23:35:15 +02:00
José Valim
eacd2d4780
Improve warnings during expansion
2017-10-21 20:43:35 +02:00
Glauber Campinho
82864d106b
Add file information to the dispatches on the source manifests ( #6954 )
2017-10-21 11:53:06 +02:00
José Valim
ed98604dc3
Deprecate Range.range? in favor of pattern matching
2017-10-17 19:54:03 +02:00
Andrea Leopardi
169b8f5a77
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