Commit Graph
65 Commits
Author SHA1 Message Date
José Valim 92cf894756 Require a trailing underscore to consider it a compiler variable 2020-07-17 13:59:52 +02:00
José Valim 08706cc490 Warn if a variable that looks like a compiler variable is unused (#10198)
Closes #10197.
2020-07-15 12:20:49 +02:00
José Valim 2b05b8dcf3 Use version metadata in Erlang pass 2019-11-16 02:45:55 +01:00
Eric Meadows-Jönsson b3e48bc1cb Track variable version globally (#9536)
Instead of incrementing the version for each variable individually we increment it globally for all variables. This means we can uniquely identify each variable assignment with only the version.
2019-11-15 17:18:39 +01:00
José Valim 77ee8afe9a Apply mergev optmization on erlang pass 2019-10-29 19:37:12 +01:00
José Valim 60a472e1ae Further optimize variable merging 2019-10-29 17:17:53 +01:00
José Valim 9529e528cc Move unused_vars to its own variable 2019-10-29 17:17:53 +01:00
José Valim a3b1ba5a44 Remove a need to merge unused vars 2019-10-29 17:17:53 +01:00
José Valim cf9a833ff9 Simplify scoped merge of unused vars 2019-10-29 17:17:53 +01:00
José Valim b08593b9d1 Add compiler tracing (#9247)
This feature allows IDEs and other tools wanting to
perform source code analysis to do so reliably without
a need to reimplement Elixir's compiler expansion and
without relying on Elixir's private APIs.

This commit also adds :parser_options to compiler
options, which allows developers to combine both options
to retrieve more accurate information, such as columns.
2019-08-02 13:35:12 +02:00
José Valim 6c5ad7b661 Clean up Macro.Env and hide private fields 2019-07-25 22:07:51 +02:00
José Valim 59fcce0b92 Unify error handling and compiler deadlock checking (#9009) 2019-05-02 16:27:13 +02:00
José Valim b68ef52b94 No longer keep a field for tracking type in __ENV__ vars 2019-04-11 00:42:48 +02:00
Fernando Tapia Rico 83519a33cd Remove warning related to imperative assignments (#8288)
Closes #8285.

This warning has to be removed because all of the forms were
unified in v1.7, making case/with/if to behave the same.
That leads to undesired warnings in cases such as:

    a = 1

    with {:ok, a} <- my_fun(a) do
      :ok
    end
2018-10-17 15:43:24 +02:00
José Valim 6d4c581cf2 Improve unused variable warnings (#8071) 2018-08-15 12:13:53 +02:00
José Valim ae6668f846 Repeat the variable name at the end for convenience 2018-08-05 21:25:10 +02:00
Michał Muskała 3803712e0a Don't maintain order in env.vars 2018-07-25 00:10:02 +02:00
Michał Muskała 656ecdf5ef Optimise var building 2018-07-25 00:10:02 +02:00
Michał Muskała 0b816eb4e1 Refactor elixir_quote:linify 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
Michał Muskała 097de7d308 Introduce __STACKTRACE__ (#7134) 2018-02-03 14:09:47 -02:00
José Valim 219c6cc867 Move unused_vars check to Elixir land
This gives us better control over when and how unused variables are printed.

As a result, we are able to emit unused variable warnings in situations
we could not before. This also opens up the way for us to remove a
dependency on erl_lint and track types information, which allows us to
speed up compilation times about 5% and allow us to emit more performant
code in some situations.
2018-01-20 19:45:48 +01:00
José Valim 1233a6f644 Optimize variable merging 2018-01-20 19:42:08 +01:00
José Valim 239db307a2 Merge match_vars and prematch_vars 2018-01-20 19:42:08 +01:00
José Valim f99bb7c0e5 Process variable versioning on Elixir pass 2018-01-20 19:42:08 +01:00
José Valim fd149eeb56 Remove file from elixir_erl record 2018-01-20 19:42:08 +01:00
José Valim 113d2c69c9 Remove export_vars from Macro.Env 2018-01-20 19:42:08 +01:00
José Valim b21a1f1f85 Disable warning of IEx commands via match_vars := apply 2017-07-10 02:13:26 +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
José Valim 2eb8490f9a Add prematch_vars 2017-02-23 10:43:09 +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 e7e0d512ff Move erlang modules to new erl namespace 2017-02-19 20:20:59 +01:00
José Valim ad7642b7d6 Perform map_key check on elixir_exp 2017-02-15 20:44:06 +01:00
José Valim 4728c562db Move &1 check to expansion pass 2017-02-15 17:07:07 +01:00
José Valim 11537b4c11 Remove unused elixir_scope fields 2017-02-14 14:38:35 +01:00
Eksperimental 31822b42f0 Properly spell PID (#4883) 2016-06-25 09:03:35 +02:00
José Valim 6128444f4b Move more items away from ord* when possible 2015-10-19 12:19:15 +02:00
José Valim 5b88ef22d2 Move internal vars and backup vars from orddict to maps 2015-10-18 23:32:28 +02:00
eksperimental 61675c3ea8 Add space after comma: Format consistently 2015-03-17 22:55:27 +07:00
José Valim a7dbfd1e82 Remove broken and unfixable delegate_locals_to implementation 2015-01-06 23:34:08 +01:00
José Valim c435dbe38d Convert #elixir_env to a struct too 2014-04-30 16:32:13 +02:00
José Valim e5c13e6dd2 Convert Macro.Env to a struct 2014-04-30 15:07:50 +02: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 8e38540470 Support :into in for comprehensions 2014-02-17 14:24:17 +01:00
José Valim 79faa1f706 Do not export case and receive vars 2014-01-04 10:45:13 +01:00
José Valim 2a6940014a Move environment cache to locals tracker, which is per module 2014-01-02 20:44:32 +01:00
José + Eric 2a1941112e Cache the environment for function definition
This speeds up compilation and reduces memory consumption. For
example, Ecto test suite consumes consistently 30% less memory
and loads 20% faster.
2014-01-02 18:10:59 +01:00
José Valim 1c4b759c4e Bring back no name and simplify var merging 2014-01-01 12:22:49 +01:00
José Valim 9cd56804ea Use a main counter for hygienic variables 2013-12-31 14:20:24 +01:00