Eric Meadows-Jönsson
d1290d62db
Fix struct/0 typespec
...
Closes #4915 .
Signed-off-by: José Valim <jose.valim@plataformatec.com.br >
2016-06-30 22:18:32 +01:00
Mike Stok
301aa6eddc
keep tokenizer's column counts in sync for numbers with _ characters
...
For providing better feedback in credo and tools like it we should be
able to map a token back to its original source. This makes sure that
`_` characters in numbers are properly accounted for so that they stay
in sync after we've encountered something like 123_456_789.
Signed-off-by: José Valim <jose.valim@plataformatec.com.br >
2016-06-30 10:31:13 +01:00
José Valim
8930ea7598
Do not attempt to load modules that have not been required, closes #4900
2016-06-29 01:20:45 +01:00
José Valim
127691d4ad
Ensure structs can be expanded in dynamic module names, closes #4894
...
Signed-off-by: José Valim <jose.valim@plataformatec.com.br >
2016-06-28 10:42:34 +01:00
José Valim
54c0574be2
Explicitly announce structs
...
Before this patch, we could announce a struct too early,
only when __struct__/0 was defined (and not __struct__/1)
leading to deadlocks in the compiler. We fixed the bug and
made struct announcements to avoid future bugs.
Closes #4844
Signed-off-by: José Valim <jose.valim@plataformatec.com.br >
2016-06-22 10:05:13 +02:00
Daniel Perez
8d50e1fa95
Improve with/else error message on invalid form ( #4847 )
...
Signed-off-by: José Valim <jose.valim@plataformatec.com.br >
2016-06-22 09:33:28 +02:00
José Valim
3ce029615d
Do not expect stacktraces to be always present, closes #4840
...
Signed-off-by: José Valim <jose.valim@plataformatec.com.br >
2016-06-21 20:27:01 +02:00
José Valim
977bb418a1
Ensure variables in function clauses are not reused, closes #4815
2016-06-15 16:14:37 +02:00
José Valim
735296a4ab
Remove elixir_counter in favor of unique_integer
2016-06-15 15:25:04 +02:00
José Valim
e34dde79ea
Ensure entries are sorted to avoid non-determinism in compilation, closes #4814
2016-06-15 15:13:31 +02:00
Eric Entin
92cf02321b
Make sure struct expansion results in a remote dispatch ( #4807 )
...
Signed-off-by: José Valim <jose.valim@plataformatec.com.br >
2016-06-12 23:52:09 +02:00
Aleksei Magusev
2b5e69aa05
Make sure with/1 does not leak variables to else ( #4804 )
...
Conflicts:
lib/elixir/src/elixir_scope.erl
2016-06-12 21:39:20 +02:00
eksperimental
3bd976737e
Use proper case for proper nouns and acronyms
...
Use proper case for proper nouns (e.g., Elixir, Rebar, Git, and others)
as well as acronyms (e.g., URL, HTTP, and others).
2016-06-06 15:17:59 +02:00
José Valim
abec905009
Use a more explicit pdict key
2016-06-04 16:47:00 +02:00
José Valim
2a1d3d6530
Keep the full list of modules being defined
2016-06-04 11:53:40 +02:00
José Valim
0168713cbf
More explicitly use the term annotation throughout
2016-06-03 01:52:15 +02:00
José Valim
405fc896ab
Propagate generated: true in Elixir definitions
2016-06-03 01:52:15 +02:00
José Valim
41c21f51cb
Update TODOs and CHANGELOG
...
* Functionality won't be removed before v2.0
* Features soft-deprecated in Elixir v1.2 will warn on v1.4
* Features soft-deprecated in Elixir v1.3 will warn on v1.5
2016-06-02 21:21:24 +02:00
José Valim
fa920eb6b8
Rename bundle/2 to describe/2
2016-05-30 12:19:21 +02:00
Andrea Leopardi
26a4fc5788
Add support for the @optional_callbacks behaviour attribute ( #4705 )
2016-05-28 13:19:12 +02:00
José Valim
c87a7dbf26
Add @enforce_keys to defstruct, defexception and friends
2016-05-26 13:26:58 +02:00
José Valim
dabe5e5102
Add struct expansion via __struct__/1
2016-05-26 12:40:12 +02:00
Eric Entin
b15d641e42
Add mix xref --callers M.f/a ( #4683 )
2016-05-25 21:53:42 +02:00
Eric Entin
0395bac1c1
Warn for remote calls that cannot be resolved at compile time ( #4639 )
2016-05-22 11:20:45 +02:00
José Valim
793e657eaa
Store function definitions and clauses in the same table
2016-05-19 13:23:19 +02:00
José Valim
478ec42778
Use the shortest possible representation when printing floats, closes #3413
2016-05-18 14:38:44 +02:00
José Valim
b38ace0a79
Tidy up LexicalTracker
2016-05-18 08:42:33 +02:00
José Valim
4f47f03707
Improve unsafe vars warning
2016-05-16 13:40:46 +02:00
Aleksei Magusev
d22e456047
Improve warning output ( #4631 )
2016-05-16 00:10:51 +02:00
José Valim
b79b041fad
Improve ambiguous pipe message
2016-05-15 20:46:37 +02:00
José Valim
7cac73a095
Unify warning calls
2016-05-15 20:34:29 +02:00
Adán Sánchez de Pedro Crespo
b0261c7b83
Make lexicals (alias, import and require) return the given module(s) instead of nil ( #4629 )
...
* Make lexicals return module name instead of nil
* Update tests
2016-05-15 17:53:10 +02:00
Aleksei Magusev
9d03be21b9
Do not emit warning when "with" clause always matches ( #4597 )
2016-05-09 20:06:33 +02:00
eksperimental
9d4ec8b5f3
Fall-back functions: Kernel.to_char_list/1 and List.Chars.to_char_list/1 protocol
2016-05-09 00:35:44 +07:00
eksperimental
0aece49e2d
Replace 'char_list' and 'char list' with 'charlist'
2016-05-07 03:20:57 +07:00
eksperimental
6da34e0225
Standardize unicode and friends ( #4569 )
...
* Unicode is a proper noun, so it should be capitalized
* Replace 'char data' with 'chardata'
* Correct use of a/an articles
2016-05-05 09:21:05 +02:00
eksperimental
4ceb41e71b
Formmating: Add white space around vertical bar ( #4507 )
2016-04-25 00:55:49 +02:00
eksperimental
bed9816549
Formatting: add white space after comma ( #4491 )
...
Standardizes the use of comma leaving a white space after it whenever applicable.
Note: It does not enforce this in quantifiers in regular expressions such as in: `x{1,3}`
2016-04-19 01:23:50 +02:00
José Valim
fae0134001
Do not build structs if not necessary
2016-04-13 16:56:15 +02:00
José Valim
89695b2837
Add more test cases to try, improve error message
2016-04-11 12:37:14 +02:00
Daniel Perez
b2e8c1451e
Allow generated variables in map keys. Fix #4428 ( #4504 )
2016-04-11 12:27:10 +02:00
José Valim
7ce93f6c8b
Normalize and document time and time units
2016-04-05 17:21:33 +02:00
James Fish
8095e867e7
Merge pull request #4455 from whatyouhide/system-os-time
...
Add System.os_time/0,1 and update time-related docs in System
2016-04-04 23:42:47 +01:00
José Valim
51feaa5e62
Handle chars literals in the parser for better syntax errors
...
Handle chars literals in the parser for better syntax errors
2016-04-04 21:35:12 +02:00
Andrea Leopardi
8619d26c4d
Handle chars literals in the parser for better syntax errors
...
Before this commit, we handled char literals (like `?a`) in the
tokenizer, turning a literal like `?a` into the token `{:number, _,
97}` (thus indistinguishable from the literal `97` at the parsing
stage). This led to error messages with the integer for the character
instead of the character literal, e.g.:
iex> :ok ?a
** (SyntaxError) iex:11: syntax error before: 97
With this commit, we now turn `?a` into the token `{:char, _,
97}` (which is the same token used by Erlang for Erlang char literals
like `$a`); since it's the same token as in Erlang, the parser will now
output the char literal as an Erlang char (`?a` would be printed as
`$a`). We hijack the error message in elixir_errors.erl to end up with
the correct message:
iex> :ok ?a
** (SyntaxError) iex:11: syntax error before: ?a
2016-04-04 21:29:15 +02:00
José Valim
ca856d774e
Spell out our deprecation policy
2016-04-03 13:52:15 +02:00
José Valim
a913f45442
Update TODOs
2016-04-03 13:00:48 +02:00
Andrea Leopardi
8147fe48e2
Show the full call when calling a function inside a match
...
Right now, when we call a local function inside a match the error
message only shows the function name and its arity (`foo/1`). With this
commit, we show the full call (`foo(:bar)`) so that it should be easier
to locate the error.
2016-03-31 11:33:32 +02:00
Andrea Leopardi
32a70fabdc
Add System.os_time/0,1
...
These functions are inlined to `:os.system_time/0,1`.
2016-03-30 23:03:39 +02:00
Andrea Leopardi
7b16e64ef8
Add final newlines to a bunch of files
...
A bunch of files didn't end with a final newline (according to the POSIX
standard -
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 ).
2016-03-29 23:02:22 +02:00