José Valim
4b134c8cf5
Raise on invalid map syntax, closes #7268
2018-01-28 11:04:25 -02:00
José Valim
2a1ca02622
Implement child_spec/1 for DynamicSupervisor
2018-01-27 20:05:49 -02:00
José Valim
00c7a3bc60
Merge binaries and bitstrings when possible
2018-01-25 15:40:44 -02:00
José Valim
12153869c5
Support comments in the middle of pipelines and type expressions
...
Closes #7231
2018-01-24 13:09:19 +01:00
José Valim
8a23ec182c
Do not expose current_vars, provide proper APIs in Macro.Env
2018-01-23 10:02:00 +01:00
José Valim
9ef646eed5
Support bitstrings in Collectable
...
Closes #7234
2018-01-21 13:25:11 +01:00
José Valim
5dedbed881
Ensure do blocks do not exceed line length on single arguments
...
Closes #7232
2018-01-21 00:53:04 +01:00
José Valim
219c6cc867
Move unused_vars check to Elixir land
...
This gives us better control over when and how unused variables are printed.
As a result, we are able to emit unused variable warnings in situations
we could not before. This also opens up the way for us to remove a
dependency on erl_lint and track types information, which allows us to
speed up compilation times about 5% and allow us to emit more performant
code in some situations.
2018-01-20 19:45:48 +01:00
José Valim
f99bb7c0e5
Process variable versioning on Elixir pass
2018-01-20 19:42:08 +01:00
José Valim
113d2c69c9
Remove export_vars from Macro.Env
2018-01-20 19:42:08 +01:00
José Valim
abb929eda4
Format stream_test
2018-01-19 23:32:00 +01:00
José Valim
c38fa49a74
Improve undefined behaviour warning
2018-01-19 12:01:21 +01:00
José Valim
69bee9a472
Support zipping of any collection, closes #7219
2018-01-19 11:22:11 +01:00
José Valim
bfa3cfba19
Only rearrange not in if explicitly opted-in
...
Closes #7227 .
2018-01-19 10:54:39 +01:00
James Fish
ef1f406d25
Reorder kw blocks in Macro.to_string ( #7225 )
2018-01-18 22:52:29 +01:00
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
684397f59c
Normalize built-in attributes error messages
2018-01-12 21:01:44 +01:00
José Valim
a719605abf
Use flex_glue for bitstrings and tuples in the formatter ( #7183 )
...
Closes #7152
2018-01-11 10:07:48 +01:00
José Valim
a7eb9adfe9
Consider case ignorable characters on Greek downcasing, closes #7149
...
Note this does not impact the runtime cost of other downcasing
operations. The final beam file grew only in 8kb.
2018-01-09 13:59:13 +01:00
José Valim
f34d74913c
Warn if heredoc is outdented, closes #7174
2018-01-07 17:46:42 +01:00
Frank Hunleth
df17e81d16
Fix inspect for non-decimal negative integers ( #7181 )
...
Before:
iex> inspect(-1, base: :hex)
"0x-1"
After:
iex> inspect(-1, base: :hex)
"-0x1"
This change also applies to the octal and binary base options.
2018-01-05 18:44:17 +01:00
José Valim
6fa3881beb
Properly handle :erlang.element in Exception blame
2018-01-05 17:22:20 +01:00
José Valim
e044b661b9
Rearrange equals and inserts for shorter diff scripts
...
Closes #7169 .
2018-01-02 23:06:52 +01:00
José Valim
889ae9afbb
Do not leak variables during optimizations, closes #7161
2018-01-01 12:04:15 +01:00
José Valim
cbde356d10
Organize struct name matching in map_test
2017-12-30 18:42:45 +01:00
Donald Little
b74de02190
Return right side expression value on struct matching ( #7160 )
2017-12-30 18:35:40 +01:00
José Valim
c270e7211f
Remove deprecation warnings
2017-12-26 23:18:18 +01:00
José Valim
44a8f665b1
Improvements to greek handling of downcase, closes #7149
2017-12-26 23:11:17 +01:00
José Valim
9e232a60a1
Store expanded expressions in defguard, closes #7147
2017-12-26 00:06:28 +01:00
José Valim
ff153b786b
Revert "Add support for supervisor fun to Task.Supervisor.async_stream/* ( #6552 )"
...
This reverts commit 91061bf8f9 .
2017-12-23 20:01:32 +01:00
José Valim
eab6f412dd
Format protocol dialyzer test
2017-12-22 13:38:03 +01:00
José Valim
112ffc65f8
Ensure no dialyzer warnings after protocol consolidation, closes #7107
2017-12-22 12:36:24 +01:00
José Valim
9941745afb
Do not move comments from first argument of no parens calls, closes #7130
2017-12-22 11:27:32 +01:00
José Valim
9a52f2a3c9
Format string.ex and improve upcase coverage
2017-12-20 12:13:25 +01:00
José Valim
18288881c2
Provide :greek and :ascii mappings in String upcase/downcase/capitalize
...
Closes #7105 .
2017-12-20 11:54:06 +01:00
José Valim
afd51e82d5
Make split operations consistent with replace
...
Both String.replace/3 and Regex.replace/3 consider there is
an empty string before and after the subject when doing replacements:
String.replace("abc", "", "x")
#=> "xaxbxcx"
This change makes String.split/2 and Regex.split/2 consistent
with this operation by returning empty strings before and after
the split subject:
String.split("abc", "")
#=> ["", "a", "b", "c", ""]
Closes #7023
2017-12-20 10:55:32 +01:00
José Valim
0727eaf37d
Do not invoke after_fun in chunk_while if emitted element halts, closes #7112
2017-12-19 13:53:03 +01:00
José Valim
cee51304b3
Reduce the number of ets lookups for reading impl
2017-12-19 12:03:55 +01:00
Glauber Campinho
1d58413053
Introduce @deprecated ( #7113 )
2017-12-19 11:44:35 +01:00
Glauber Campinho
c4113cd4d4
Improve protocol consolidation tests for docs ( #7119 )
...
`Code.get_docs/1` calls `:code.get_object_code/1` with the module and
this returns the old binary instead the consolidated one.
2017-12-17 09:33:00 +01:00
José Valim
5294a739b4
Also consider when acc_count is more than count
2017-12-15 10:25:29 +01:00
Alberto Almagro Sotelo
c7bf764f24
Fix Stream.chunk_every/4 odd results when step > count ( #7114 )
...
Stream.chunk_every/4 was giving odd results when step was greater than
count and the last element of the enumerable was the same as last
chunk's last element.
This commit fixes this issue and adds tests for different scenarios when
step > count. It also adds a doctest example to reflect this in the
documentation and test it simultaneously.
Fixes #7096
2017-12-15 10:21:38 +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
b4aac2d7be
Do not indent right-side of pipelines in the formatter ( #7103 )
2017-12-11 21:07:30 +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
29e8385409
Fix count_children for Task.Supervisor, closes #7101
2017-12-11 16:13:29 +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
José Valim
c063093d32
Inspect tuples closer to the formatter, closes #6509
2017-12-06 12:01:48 +01:00
Donald Little
3086b68636
Show UTF-8 BOM on inspected strings ( #7085 )
2017-12-03 14:04:52 +01:00