Commit Graph
1227 Commits
Author SHA1 Message Date
Aleksei Magusev 654cd77501 Simplify function kind check in elixir_def_overridable.erl 2016-06-22 13:11:43 +02:00
Andrea Leopardi 881c2d6638 Support macros with defoverridable/super (#4848) 2016-06-22 11:40:24 +02:00
José Valim f4b5e43fc1 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
2016-06-22 10:05:01 +02:00
Daniel Perez e9f2c2547d Improve with/else error message on invalid form (#4847) 2016-06-22 09:30:54 +02:00
José Valim 077aca5db1 Do not expect stacktraces to be always present, closes #4840 2016-06-21 20:26:46 +02:00
Pedro Medeiros 0066d11771 Simplify code to remove warning: unsafe in 'case' (#4816) 2016-06-15 18:41:01 +02:00
José Valim 1aca21c876 Ensure variables in function clauses are not reused, closes #4815
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2016-06-15 16:14:48 +02:00
José Valim 5f34ad6dc7 Remove elixir_counter in favor of unique_integer
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2016-06-15 15:25:28 +02:00
José Valim 8d368a8836 Ensure entries are sorted to avoid non-determinism in compilation, closes #4814
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2016-06-15 15:25:24 +02:00
Eric Entin 2d7017fcc7 Make sure struct expansion results in a remote dispatch (#4807) 2016-06-12 23:38:51 +02:00
Aleksei Magusev 50c5ea5a03 Make sure with/1 does not leak variables to else (#4804) 2016-06-12 21:26:06 +02:00
José Valim 25ca5c825a Disable relative paths when loading mix.exs, closes #4465 2016-06-12 18:55:00 +02:00
Gary Rennie 9a74ea7520 Include with when warning about unsafe variables (#4800)
The unsafe variable warning can be triggered from the following `with`:

    state = true

    with true  <-state, state = !state,
    do: state,
    else: (other -> {other, state})
2016-06-12 15:37:39 +02:00
Aleksei Magusev 0bf89538c6 Standardize use of "variable" word in warnings and errors 2016-06-12 00:27:30 +02:00
Aleksei Magusev 96da837136 Emit warning when variable is being expanded to function call (#3517) 2016-06-11 22:31:03 +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