Commit Graph
60 Commits
Author SHA1 Message Date
Pablo Costas 110dfe67aa Fix tokenizer emitting repeated warnings in the REPL (#9924)
Now we only emit tokenizer warnings upon tokenization success.
2020-04-10 00:48:49 +02:00
José Valim 3300016a85 Fix Erlang compiler bug on 21.0 2020-04-10 00:46:37 +02:00
José Valim 3d3e233255 Refactor binary handling 2020-04-05 20:15:50 +02:00
José Valim 5918b24d72 Allow file, line and context to be dynamically set on quote, closes #9721 2020-01-23 20:26:16 +01:00
José Valim 2b05b8dcf3 Use version metadata in Erlang pass 2019-11-16 02:45:55 +01:00
José Valim ed272a96cb No need to track stacktrace usage 2019-11-03 13:56:39 +01:00
José Valim d5a1cf5107 elif to else 2019-11-03 13:06:30 +01:00
Łukasz Jan Niemier 2c8e75c3d3 Cleanup TODOs for OTP 21+ (#9477) 2019-11-03 13:05:18 +01:00
José Valim afa860ab4a Remove unecessary Erlang macro 2019-11-01 19:19:54 +01:00
José Valim 77ee8afe9a Apply mergev optmization on erlang pass 2019-10-29 19:37:12 +01:00
José Valim 783ceb4507 Ensure local captures work correctly on macro expansion
Closes #9245
2019-07-27 11:28:05 +02:00
Arjan Scherpenisse cef19c9365 Implement static_atom_encoder tokenizer option (#8956) 2019-04-14 19:44:17 +02:00
José Valim ec2e092fdd Add no_spawn_compiler_process option to previous OTP releases
Because Elixir may be compiled with Erlang/OTP 20
to run on Erlang/OTP 22.
2018-12-15 23:20:26 +01:00
José Valim 1ca25436be Use the no_spawn_compiler_process in more recent release
See https://github.com/erlang/otp/pull/1972.
2018-10-03 14:02:46 +02:00
Michał Muskała ffb931a5ac Fix all compiler warnings (#7992) 2018-07-27 16:42:24 +02:00
Michał Muskała 335cfdbcad Separate testing for unquotes from escaping 2018-07-25 00:10:02 +02:00
Michał Muskała 4229536799 Inline construction of remote erlang calls in compiler 2018-07-25 00:10:02 +02:00
José Valim 34befaaa36 Allow to prune metadata while escaping (#7949)
We use this option in ExUnit as we are escaping
the code to eventually convert it to a string
representation and therefore the metadata is not
relevant.
2018-07-21 12:56:07 +02:00
José Valim beb596d37c Warn on unnecessary quotes (#7838) 2018-07-10 10:27:02 +02:00
José Valim 5edb1d2739 Add hints on mismatched do/end and others pairs
When you are working on large files and you add new code,
you may forget to add a `do` or an `end`. In those cases,
the error message usually points to the first `do` or the
last `end` in the file, which are usually far away from
the source of the error.

This pull request adds a simple heuristic based on the
indentation of the tokens, to try to provide hints of
where the source may be. Those hints are not deterministic
but they may be able to point users to the source of the
problem.

For example, in this case:

    defmodule MyApp do
      def one do
      # end

      def two do
      end
    end

we know that we now that `def two do` is happening on the
same indentation as `def one do`, which may mean that
`def one do` was not closed properly. We store this as a
hint in case the terminators do not match later.

Similarly, in the case below:

    defmodule MyApp do
      def one
      end

      def two do
      end
    end

The `end` on line 3 will end-up closing the defmodule `do`,
on line 1. Because their indentation do not match, it may
be that there is a missing `do`, where the `end` was supposed
to align.

Some basic testing show those heuristics work on the majority
of the cases, but we will only be sure when we have enough
feedback from the community.
2018-06-10 13:55:49 +02:00
Michał Muskała 097de7d308 Introduce __STACKTRACE__ (#7134) 2018-02-03 14:09:47 -02:00
José Valim fd149eeb56 Remove file from elixir_erl record 2018-01-20 19:42:08 +01:00
José Valim 1ba04d15d8 Remove export_vars in elixir_erl record 2018-01-20 19:42:08 +01:00
José Valim 455c2c3f3b Rely on side effects for preserving comments
The previous implementation would not lead to parsing
errors in interpolations since code inside interpolation
is parsed immediately.
2017-10-05 13:27:25 +02:00
José Valim 1e648fc73e Allow strings/atoms/charlists to be emitted unescaped 2017-08-23 17:36:09 +02:00
José Valim 4185a09610 Continue raising on unbound __CALLER__ 2017-07-13 15:16:19 +02:00
José Valim 0125cd05ed Ensure with is tail call optimizable
Closes #6251
2017-07-11 20:24:21 +02:00
José Valim 73382f828b Move match vars handling and warnings to elixir_expand
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2017-07-07 16:11:40 +02:00
José Valim 76c533f30e Ensure defaults and defoverridable work together, closes #6300
This commit changes the private super implementation to have
a tuple with the {kind, name} as first argument.
2017-07-06 15:47:56 +02:00
Alex Jiao 8e9ea26ddf Add a preserve_comments option to the tokenizer (#6222) 2017-06-21 10:09:52 +02:00
José Valim 9873e4239f Add non-quoted Unicode atoms and variables (#6158)
It follows Unicode Annex #31.

See the Unicode Syntax document for a more in-depth reference.
2017-05-27 22:43:05 +02:00
José Valim 3625f0d8be Keep ?var_context per module to avoid chance of conflicts 2017-02-24 01:29:44 +01:00
Aleksei Magusev 0f1f773764 Use elixir instead of Elixir for var_context/0 2017-02-21 21:01:28 +01:00
Aleksei Magusev ec9248e51d Add var_context/0 helper macro 2017-02-21 21:01:28 +01:00
José Valim a7316e752f Fix how the generated annotation is handled in Elixir 2017-02-20 23:14:16 +01:00
Aleksei Magusev a729847db6 Rename m/2 helper macro to key/2 in the main header file 2017-02-19 21:56:05 +01:00
José Valim ff8dd1af7f More module renaming and organizing 2017-02-19 21:20:43 +01:00
José Valim e7e0d512ff Move erlang modules to new erl namespace 2017-02-19 20:20:59 +01:00
José Valim f56812acb7 Start moving files to elixir_erl 2017-02-19 19:40:21 +01:00
José Valim d5ec484a69 Convert default argument handling to Elixir pass 2017-02-18 19:44:38 +01:00
José Valim d09d5874a9 Clarify code comments 2017-02-18 00:24:25 +01:00
José Valim 152cf2616b Move case inlining out of Elixir pass 2017-02-16 18:24:25 +01:00
José Valim 482041e7ff Move tokenizer macros to tokenizer 2017-02-15 23:05:02 +01:00
José Valim 11537b4c11 Remove unused elixir_scope fields 2017-02-14 14:38:35 +01:00
José Valim 88f7dc140e Remove super attribute from elixir_scope 2017-02-08 14:42:08 +01:00
Aleksei Magusev 837a720037 Add TODO about generated/0 removal 2016-10-09 11:29:14 +02:00
José Valim c05151f278 Update CHANGELOG 2016-09-17 22:40:54 +02:00
Michał Muskała 8277dcd776 Make sure bad remote call errors have file/line info (#5116)
Change how we mark the generated AST for suppressing dialyzer errors -
instead of [generated: true, location: 0], we provide proper line number.
This means, however, that on OTP 18, those nodes won't be recognized
as generated and warnings will be issued.
It was decided that proper error messages are more important than
avoiding bogus dialyzer warnings.
The old mark for generated code is left in places that made compiler
issue warnings on 18.

The bad remote call dialyzer warnings can be suppressed with the
@dialyzer :no_fail_call
module attribute.
2016-08-15 13:18:09 +01:00
José Valim 8b6145d8f9 Support generated: true in quote 2016-02-15 11:56:50 +01:00
José Valim 49e5775065 Enable unsafe warnings for && and || 2016-02-06 21:53:54 +01:00