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
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
James Fish
9a65cbc082
Do not raise on non-integer values in is_odd/is_even ( #7063 )
2017-11-26 12:54:37 -02:00
Ivan Kozik
47a3b0897d
Clarify File.exists? behavior for dangling symlinks ( #7056 )
2017-11-22 01:51:06 -02:00
Aleksei Magusev
fb2d25516f
Consider microseconds in maximum possible Calendar.ISO datetime ( #7055 )
2017-11-21 23:18:43 +01:00
José Valim
ce4e0099e2
Properly take "do" into account on line breaks, closes #7052
2017-11-21 14:54:42 -02:00
Eric Meadows-Jönsson
d8a533d19f
assert_receive should expand in match context ( #7042 )
...
Closes #7041 .
2017-11-19 07:24:25 -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
Glauber Campinho
eb0891b94b
Fix @impl warnings with default arguments ( #7028 )
2017-11-15 12:04:23 +01:00
Glauber Campinho
505c10e474
Support uniq: true in for comprehensions ( #7020 )
2017-11-13 23:00:53 +01:00