Commit Graph
103 Commits
Author SHA1 Message Date
Alex Jiao d74bd047df Add terminator info to sigil AST node metadata (#6305) 2017-07-08 01:05:37 +02:00
Jake Becker 90296aa680 Add --all-warnings option to Elixir compiler (#6224)
* Track Elixir build warnings in the manifest

* Add --all-warnings option to Elixir compiler

* Document "each_warning" option in ParallelCompiler

* Handle old manifest version :v6 when parsing manifest

* Track warnings during compile using a map in the Agent's state
2017-06-18 21:40:29 +01:00
Michał Muskała 640125449b Clean-up use of get_stracktrace in elixir_errors.erl (#6092)
It's possible get_stacktrace won't work outside of catch clauses in the future.

Reference: https://github.com/erlang/otp/pull/1449
2017-05-11 09:44:43 +02:00
José Valim 102a8a3fa8 Add elixir_erl_compiler 2017-02-23 13:15:26 +01:00
José Valim 412d5f5661 Start refactoring on elixir_compiler 2017-02-23 13:15:26 +01:00
José Valim d27b4c6479 Remove duplication in format_errors 2017-02-10 20:55:53 +01:00
José Valim c1e4274162 Improve compiler message on unexpected end of line, closes #5137 2016-11-20 11:01:30 +01:00
José Valim f0b84922d9 Ensure we consistently wrap variables in quotes 2016-10-22 22:25:18 +02:00
Aleksei Magusev d22e456047 Improve warning output (#4631) 2016-05-16 00:10:51 +02:00
José Valim 7cac73a095 Unify warning calls 2016-05-15 20:34:29 +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
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 e0aeb953c6 Format beam validator errors properly, closes #4263 2016-02-06 17:23:18 +01:00
Aleksei Magusev ecd86761da Cover bittype_mismatch error missing in :erl_lint.format_error/1
For example, `<<0::little-big>>` expression.
2015-12-05 12:53:18 +01:00
José Valim 8703e9655e Unify undefined function messages 2015-11-24 22:07:16 +01:00
José Valim 3ccd5137ef Add generated annotations 2015-10-11 12:02:47 -05:00
José Valim 9a0911a6a7 Handle warns coming from erlang with line set to :none 2015-08-21 16:31:49 +02:00
José Valim bb36b5f3ea Refactor extraction of meta location 2015-05-16 10:41:39 +02:00
Or Neeman 5b0bbb2d72 Bugfix to syntax error before sigil
Closes #3324
2015-05-12 14:35:05 -06:00
José Valim ec0702ff18 Embed consolidation information as a function in the protocol 2015-04-30 23:02:45 +02:00
eksperimental 61675c3ea8 Add space after comma: Format consistently 2015-03-17 22:55:27 +07:00
Or Neeman 2319400358 Refactor compiler errors (elixir_errors:parse_error/4) 2015-03-05 19:45:15 -06:00
Or Neeman 3ce822ecd2 Produce clearer messages for syntax errors before a sigil
Closes #3130
2015-03-05 06:25:59 -06:00
José Valim 20bf4b0995 Ignore exported vars warning
Closes #2798
2015-01-28 21:49:55 +01:00
Xavier Defrang 7381cbee02 Invert the order of non matching token messages (closes #2993) 2015-01-10 09:40:44 +01:00
Alexander Ivanov c76a186687 Change location info format in tokenizer
Start column counting in tokenizer from 1, store location info in a tuple `{Line, BeginColumn, EndColumn}` instead of a list
2015-01-05 13:35:23 +02:00
Alexander Ivanov a288ddd326 Add column info in tokenizer, #2987
Add column info for each token in elixir_tokenizer.
Change the format of location info from `Line` to `[Line, BeginColumn,
EndColumn]`. Pass the current column after the current line in
`elixir_tokenizer:tokenize`. Reflect the change in related modules.
2015-01-05 03:34:53 +02:00
José Valim 0c5b3d5e67 Improve token errors for aliases, closes #2818 2014-10-21 11:41:36 -02:00
José Valim 08677de10d Properly handle eval_failure warnings, closes #2835 2014-10-21 11:08:21 -02:00
James Fish 2417b196a4 Fix elixir dialyzer warnings 2014-09-03 19:29:01 +01:00
José Valim a1e4a2741f Avoid unecessary wrap inside do keyword 2014-07-19 18:13:38 +02:00
José Valim 2865bd8653 Make elixir_errors API more strict and consider :file in meta 2014-07-08 18:54:40 +02:00
José Valim 1bd0ca6dea Return explicit :ok from more functions 2014-07-05 13:43:52 +02:00
José Valim 6c3a4bd019 Fix the guard for this clause evaluates to false warning
Since the guard can be hidden inside if/unless, it is better
to have a more generic error, stating we will always get the
same result from an check/guard.
2014-07-03 00:58:02 +02:00
José Valim 55e885f5c5 Ensure we don't leak erlang terms on failure, closes #2303 2014-05-21 12:44:12 +02:00
José Valim be34a75124 Disabling :hygiene in quote is deprecated 2014-05-19 18:25:56 +02:00
José Valim ca6788113e Deprecations should go to standard_error 2014-05-16 22:39:56 +02:00
José Valim c22e8e85dc Convert exceptions to structs 2014-05-16 00:01:49 +02:00
James Fish be0564b536 Fix some dialyzer warnings 2014-04-30 00:44:40 +01:00
José Valim 0814d0b442 Properly format binary tokens on errors, closes #2144 2014-04-29 15:05:24 +02:00
James Fish 5cadeeea67 Fix some dialyzer warnings 2014-04-28 21:33:03 +01:00
José Valim 56f15d9f4e Do not add spaces after { and before }
This makes the source code consistent with the result
returned by inspect/2.
2014-04-21 19:06:35 +02:00
José Valim c37a244d66 Add Code.eval_file/2 2014-03-27 12:31:00 +01:00
José Valim 3d6dd50866 Remove native checks and improve typespecs 2014-03-08 12:46:16 -08:00
José Valim c07b0d0912 Remove deprecate code 2014-02-02 20:22:28 +01:00
José Valim e855a85c85 Merge branch 'issue-2022-warnings' of github.com:ShaneWilton/elixir into ShaneWilton-issue-2022-warnings
Conflicts:
	lib/elixir/test/elixir/kernel/warning_test.exs
	lib/iex/test/iex/helpers_test.exs
2014-02-01 09:35:49 +01:00
Shane 36d1dcd9cc Prefix all warnings with [warning]
We expose :elixir_errors.warn/2 and :elixir_errors.warn/3
The first is to be used when we have detailed caller information,
such as from a stacktrace. The second is useful when our only
context is a line number and filename.

Note also that the test for module redfinition is performed in
helpers_test.exs rather than in warning_test.exs Perhaps this is
something that should be moved.
2014-01-29 11:35:43 -05:00
José Valim 5f682023a6 Deprecate usage of @behavior in favor of @behaviour 2014-01-28 11:21:55 +01:00
José Valim 0aff2a3139 Compile with relative paths and include apps in stacktraces
Closes #1964, closes #1861
2014-01-07 11:30:44 +01:00