José Valim
e700f1c159
Group operands but not the operator
...
Closes #7007
2017-11-07 13:08:37 +01:00
José Valim
ef59364202
Add end_line information to string_to_quoted tests
2017-11-07 11:02:21 +01:00
José Valim
9c95ee96b3
Consider comments inside function calls
...
Closes #6994
2017-11-07 10:50:11 +01:00
José Valim
3a42330d51
Pass the proper precedence to binary operator handling, closes #7005
2017-11-07 09:37:02 +01:00
José Valim
f97900cd37
Raise on reserved tokens, closes #6532
2017-11-06 17:15:44 +01:00
José Valim
f09748421d
Add examples of String going across boundaries, closes #6373
2017-11-06 12:52:14 +01:00
Chris Keele
c2eee76805
Adds Kernel.defguard/1 macro to build guard-safe macros
...
This makes defining guards easier, since it does the boilerplate
for you and raises at compile time in the defguard macro when
you do something not allowed in guards (as opposed to whenever
the new guard happens to be used as a guard).
It takes a `defguard name(args) when implementation` invocation,
passes the implementation through `:elixir_expand.expand/2` in
a guard context, and if nothing is raised, transforms the impl
into a macro that works both inside and outside of guard contexts.
Signed-off-by: José Valim <jose.valim@plataformatec.com.br >
2017-11-06 12:39:53 +01:00
Andrea Leopardi
1a33a8a95c
Add @specs to functions in the Code module ( #7003 )
2017-11-04 10:50:50 +01:00
José Valim
ff29aa8e66
Ensure file in stacktraces is a charlist
2017-11-03 22:25:07 +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
82711f01ec
Warn if init/1 is not implemented in GenServer
...
This brings GenServer closer to the implementation in OTP
and aligns all behaviours to require the init/1 callback.
Closes #6998 .
2017-11-03 18:49:07 +01:00
Andrea Leopardi
a0c99d56d2
Improve documentation all around the Code module
2017-11-03 16:39:18 +01:00
Andrea Leopardi
4c15610168
Fix a formatting bug in the documentation for Application.spec/1
2017-11-03 16:37:10 +01:00
Andrew Dryga
1eff4fe184
Mention that HiPE-compiled modules won't call @on_load callback ( #7002 )
2017-11-03 13:12:52 +01:00
José Valim
33a90fc68d
Increase long compilation threshold
...
The threshold exists to help detect files that are stuck
but because of the dependency resolver in the parallel
compiler sometimes a file just takes long waiting for
another file.
To avoid false positives, we have increased the threshold
to 15 seconds.
2017-11-03 12:08:33 +01:00
José Valim
f93f304886
Improve docs for Module.create/3
2017-11-02 23:29:08 +01:00
José Valim
f8374ab5b7
Support slice on outdated protocol implementations
2017-11-02 19:00:04 +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
José Valim
61cc39db8c
Ensure we handle :undefined returns for optional callbacks, closes #6993
2017-11-01 20:27:41 +01:00
José Valim
3451e49ef1
Fix bootstrapping issues
2017-11-01 18:02:48 +01:00
José Valim
1597c2040f
Track structs separately from compile time deps, closes #6575
2017-11-01 17:44:12 +01:00
Bing Han
737be452bb
Improve documentation for Kernel.put_elem/3 ( #6995 )
2017-11-01 16:00:59 +01:00
José Valim
f73aa5f8dd
Remove test marked with @tag :skip
...
The test is implemented in typespec_tesst as an error.
2017-10-31 14:26:30 +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
82f49d44bf
Do not generate specs for exceptions
2017-10-31 11:21:33 +01:00
José Valim
be47d06764
Inline expressions when possible
2017-10-31 10:53:14 +01:00
José Valim
27aa867b2e
Minimize generated beam size by using ranges
...
This approach is less performant when processing
sigma but compiles twice faster and takes two times
less space in disk.
2017-10-30 18:45:16 +01:00
Ben Olive
6f40fae504
Handle final sigma unicode exception
...
Signed-off-by: José Valim <jose.valim@plataformatec.com.br >
2017-10-30 18:45:16 +01:00
Eric Zhang
46dd155fc4
Raise when calling GenServer.stop/3 with current process ( #6987 )
2017-10-30 10:35:08 +01:00
José Valim
2731b1355f
Consistently use GenServer API in Supervisor
2017-10-29 22:31:55 +01:00
Vahid Fazlollahzade
d124b05b6c
Document Enum.EmptyError exception for Enum.reduce/2 ( #6986 )
2017-10-28 15:40:25 +02: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
e728d28537
Tidy up implementation detail section
2017-10-26 15:57:16 +02:00
Andrea Leopardi
e8c7d48cf7
Fix formatting of multiline "foo.{...}" calls ( #6979 )
2017-10-26 13:59:37 +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
5e4bd77c63
Use flex when inspecting tuples
...
This aligns better with the formatter latest style
2017-10-26 10:46:27 +02:00
José Valim
a815313750
Store the number of defaults in the definition Meta
2017-10-26 00:18:06 +02:00
José Valim
aa79c52779
Pipe all the way in string
2017-10-25 19:58:03 +02:00
José Valim
015644ff4f
Update codebase with latest formatter rules
2017-10-25 19:39:25 +02:00
José Valim
f11a26dc70
Consistently add spaces after not
2017-10-25 19:38:56 +02:00
José Valim
6f02c12e46
Support next break fits inside tuples
...
This only applies if the tuple has not been "spaced out".
2017-10-25 19:36:34 +02:00
José Valim
b24a7a0fda
Clarify supervisor docs
2017-10-25 12:04:40 +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
171a849c8a
Also mention you may want to start an application manually
2017-10-24 16:46:17 +02:00