Commit Graph
239 Commits
Author SHA1 Message Date
Jonatan Männchen e1d171e5c7 Add inline License / Copyright to Erlang files (#14255) 2025-02-05 13:50:00 +01:00
José Valim cb2e03688e Perform return type inference and application across local calls (#13984) 2024-11-11 23:06:31 +01:00
José Valim 35d7046f31 Move imported_quoted event to elixir_quote module 2024-10-06 21:10:32 +02:00
Lukasz Samson f3c3d3dde6 Fix crash when capturing ambiguous import 2024-06-10 16:37:10 +02:00
José Valim 478256b59e Avoid discarding information on conversion to #elixir_ex 2024-06-01 17:58:01 +02:00
José Valim 1b6c31a0eb Avoid the number of duplicate traces on imports 2024-05-25 11:10:22 +02:00
José Valim f9263fdc54 Do not crash on invalid imports metadata 2024-05-20 12:44:37 +02:00
José Valim 5f2f626a05 Do not raise on Macro.Env.expand_import, closes #13573 2024-05-20 10:55:18 +02:00
José Valim 097eee9d5f Add Macro.Env.expand_import/5 and Macro.Env.expand_require/6 (#13421) 2024-03-21 10:51:10 +01:00
José Valim 9973a2eded Remove typespec from default requires 2024-02-08 15:43:20 +01:00
Jean Klingler 8cde231bbd behaviour -> behavior when not about OTP behaviours (#13240) 2024-01-09 15:25:14 +09:00
José Valim c6250bc57b Trace functions before they are inlined, closes #12925 2023-09-13 09:38:28 +02:00
José Valim b24869687b Introduce mechanism to collect several errors in a module (#12275) 2022-11-28 15:40:30 +01:00
José Valim 391a287709 Track all arities in imports inside quotes, closes #11651 2022-07-26 21:36:30 +02:00
José Valim 824f81010a Automatically cascade generated: true on macro expansion, closes #11976 2022-07-11 16:40:26 +02:00
José Valim 2a7d58c3f7 Register functions used in local macros as exports
Ideally we want to list them as requires but we don't have
the infrastructure to do so. So meanwhile, we list them
as exports, which is the same level used by require.
2022-07-11 09:09:54 +02:00
José Valim df64d5c6a1 Change import metadata to imports as a list
This is preparation to better ambiguity solving
of quoted expressions.
2022-05-08 17:00:09 +02:00
José Valim 1a880f38bd Consistently return an empty list for System.stacktrace 2021-11-09 21:57:22 +01:00
José Valim 293a1ae27b Deprecate features pending for v1.14 2021-11-09 18:34:01 +01:00
José Valim f9883d3f85 Warn if Application.compile_env is called without a require 2021-08-22 17:11:41 +02:00
José Valim f18a25fc06 Let runtime pass check for unrequired macros 2021-08-08 21:19:02 +02:00
José Valim 5eb2efe543 Break Macro.Env apart (#11164)
Previously, the internal Elixir expansion pass worked directly on
Macro.Env. However, this poised an issue, if we want to track
more information in the pass, we ended up exposing it on
Macro.Env, making it larger, and potentially slowing down
operations such as __ENV__ serialization.

This commit refactors the expansion pass to work with two
structures, the Macro.Env struct and a #elixir_ex{} record.
2021-08-03 13:35:15 +02:00
José Valim def80ad828 Ensure deprecated macros emit warnings 2021-06-23 22:15:34 +02:00
José Valim 2e759c02fa Do not hide deadlocks between imports and structs, closes #10800 2021-03-16 17:47:53 +01:00
José Valim 9d5e2db18a Fix unused variable warning 2020-11-03 20:43:05 +01:00
José Valim 42d5f9c218 Deprecate System.stacktrace/0 across the language 2020-11-03 20:28:52 +01:00
José Valim e86a91aae3 Use macros instead of special casing in the compiler 2020-07-01 15:49:14 +02:00
José Valim bb808fe683 Add line numbers to deprecated imports 2020-06-11 15:59:07 +02:00
José Valim 9ce3f7d816 Force modules to be loaded when they are required 2020-04-26 11:03:30 +02:00
José Valim f21f9af667 Rewrite and deprecate System.stacktrace 2020-02-24 21:31:37 +01:00
José Valim b2d58e5f35 Add Application.compile_env/3 (#9628)
Mix stores the compile_env in each applications' .app file.

Releases and Mix tasks were also changed to validate against
the runtime configuration against any stored `compile_env`.
In case of mismatches, an error is raised during boot.
2019-12-06 17:23:01 +01:00
Łukasz Jan Niemier 9fca33e09f Cleanup TODOs for OTP 21+ (#9477) 2019-11-03 13:05:18 +01:00
José Valim cf881389cf Remove unecessary Erlang macro 2019-11-01 19:19:54 +01:00
José Valim 9790329a08 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
Eric Meadows-Jönsson 772c078651 Remove dispatch tracking in LexicalTracker (#9228) 2019-07-18 13:48:02 +02:00
Eric Meadows-Jönsson a3c3bc0f69 Add ExCk chunk (#9203) 2019-07-09 21:23:38 +02:00
Eric Meadows-Jönsson ade3664a3a Move deprecation check to group pass (#9176) 2019-07-03 09:56:35 +02:00
José Valim e80b55b21c Unify error handling and compiler deadlock checking (#9009) 2019-05-02 16:27:13 +02:00
Fernando Tapia Rico 03b7d6cdfa Raise if a macro is invoked before its definition (#8822) 2019-02-25 22:48:21 +01:00
José Valim 64eb6af13a Rely on IO.warn whenever possible 2019-01-18 14:59:20 +01:00
José Valim 6a69616dd1 Update removal and deprecation annotations
In particular, all deprecated code would be removed on v2.0,
so we don't need to annotate dperecated code with a TODO to
remove it on v2.0.
2018-12-21 13:27:06 +01:00
Glauber Campinho 5b48933f47 Let the undefined function error be performed in Elixir-land (#8231)
Refers to #5800
2018-10-01 12:22:38 +02:00
José Valim 4ddb7cbded Correctly tag struct invocations, closes #8097 2018-08-16 23:56:47 +02:00
Michał Muskała f9eec35a00 Use scoped deterministic counters in AST expansion
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2018-08-04 12:56:01 +02:00
José Valim ddaf27116a Revert "Use deterministic counters in AST expansion"
Unfortunately it is common to have macros that invokes macros
from other modules, leading to mixed quoted expressions causing
the counters to be mixed.

We would need to scope the counters to the caller.

This reverts commit 86b7197c8a.
2018-08-04 12:29:03 +02:00
Michał Muskała 25aede7984 Fix all compiler warnings (#7992) 2018-07-27 16:42:24 +02:00
Michał Muskała 86b7197c8a Use deterministic counters in AST expansion
When the module is being compiled, we use deterministic counters instead
of random ones. This should help with most cases of undeterministic
source code or .beam files.

Closes #7955
2018-07-25 00:10:02 +02:00
Michał Muskała 276a4783f4 Inline construction of remote erlang calls in compiler 2018-07-25 00:10:02 +02:00
José Valim 2058ade2f6 Condititionally compile and lazily compute __STACKTRACE__ (#7648)
Erlang/OTP 20 warns if the stacktrace is read outside of a
catch/rescue. This commit mirrors this behaviour by consistently
warning on `System.stacktrace/0` being used outside of a
catch/rescue.

Erlang/OTP 21 warns whenever System.stacktrace/:erlang.get_stacktrace
are used. Therefore we need to promote the usage of `__STACKTRACE__`
and make sure to conditionally compile it according to the OTP version.
This requires changes to the Exception normalization mechanism
so we compute `__STACKTRACE__` only when strictly required.

In future Elixir releases, `System.stacktrace/0` will warn when
used even inside catch/rescue.
2018-05-07 15:33:36 +02:00
José Valim 2fabeb60c2 Move stdlib deprecations to @deprecated attribute (#7637) 2018-05-03 20:31:34 +02:00