Commit Graph
3186 Commits
Author SHA1 Message Date
José Valim 91e8a76bfb Fix swapped cursor_left and cursor_right
Closes #7496.
2018-03-27 10:46:59 +02:00
José Valim 09e25a75d0 Support specsdiff __info__ spec clauses, closes #7460 (#7461) 2018-03-26 16:04:20 +02:00
Glauber Campinho a4ed1c93f9 Improve error messages for lists concatenation operator (#7487) 2018-03-25 22:20:58 +02:00
Glauber Campinho 4923b8708f Improve error message for invalid clauses inside local functions (#7484) 2018-03-25 12:52:14 +02:00
Glauber Campinho add3a9666f Fix column count on heredoc tokenizer (#7486) 2018-03-25 12:37:15 +02:00
Michał Muskała 946455ec42 Validate @compile attribute in elixir (#7476)
* error on undefined inlined functions
* warn on parse transforms
2018-03-25 09:52:36 +02:00
José Valim ac1af198c8 Move accumulate attributes to a separate table (#7472)
We also speed up reading and writing of attributes via the @ macro.
2018-03-21 17:13:43 +01:00
José Valim 0ce9ea6188 Keep specs, types and callbacks in the bag table
This avoids copying typespecs in and out of the table
every time there is a new entry.

We also make sure the Protocol module is only relying
on public APIs and not on inner typespec behaviour.
2018-03-20 18:03:02 +01:00
José Valim d297fe5195 Avoid full table traversals when building "deprecated" and "docs" chunk 2018-03-20 18:03:02 +01:00
José Valim eb2418d4b1 Remove locals tracker table
Instead we use the bag and set tables accordingly.
2018-03-20 18:03:02 +01:00
Andrea Leopardi 1d14366ba4 Improve one test in the Inspect.Algebra test case 2018-03-20 14:48:01 +01:00
José Valim 4f14aea9f6 Split Kernel.Typespec into Kernel.Typespec and Code.Typespec (#7462)
Kernel.Typespec will be responsible for handling typespec
logic during compilation, such as definitions, conversion to
Erlang and warnings. Its API shall never be public.

Code.Typespec will handle the runtime aspects, such as reading
from .beam files and conversion back to Elixir AST. Its API
may be made public in the future but it is currently private.

This PR also simplifies definition of typespecs internally by
avoiding multiple macro passes and speeds up typespec processing
on OTP 20+ by skipping the translation pass from Elixir to Erlang.

The test suite was also reorganized and made async: true.
2018-03-18 22:45:44 +01:00
Glauber Campinho b5e1a76699 Improve error messages for <> operator (#7349) 2018-03-18 17:41:37 +01:00
Giuseppe Modarelli e54791c56a Add the ability to count the number of keys in a Registry (#7456) 2018-03-18 13:16:03 +01:00
José Valim d0bd8692dd Do not escape quoted keywords on formatting, closes #7451 2018-03-14 10:10:44 +01:00
Aleksei Magusev 37c3104d5e Remove unnecessary argument in a helper function in StringIOTest 2018-03-11 12:25:17 +01:00
Aleksei Magusev bc7043cbe9 Improve name of child with extra_arguments restarting test 2018-03-11 12:16:38 +01:00
Andrea Leopardi 2dee728a3e Add a "erl_lint" check for behaviour_info/1 plus callback attributes (#7422)
Part of #5800.
2018-03-07 22:48:53 +01:00
Kip Cole d91aed218e Add calendar callback months_in_year/1 (#7417)
Not all calendars have a constant 12 months in
a year.  This function returns the number of
months for a given year. Calendar.ISO will return
12 for all years.

Add Date.days_in_month/1
Date.days_in_month/1 takes a Date.t and
delegates to the Date's calendar to invoke
days_in_month/1 in the calendar module.
2018-03-05 10:26:05 +01:00
Eric Meadows-Jönsson d8dbc6f2cb Fix table column alignment with ANSI escapes (#7415) 2018-03-04 18:34:33 +01:00
José Valim f0a7f19ff4 Consider commas when breaking groups, closes #7406 2018-03-03 00:19:22 +01:00
José Valim 2b38f8a3e0 Fix the build 2018-03-03 00:05:59 +01:00
José Valim 6d94ee76e5 Ensure proper precedence between & and operators, closes #7412 2018-03-02 23:23:44 +01:00
Jay Hayes ed6c62fd83 Move doctest Macro to Macro module test file (#7408) 2018-03-01 17:50:35 +01:00
Max Veytsman d94a9ccf33 Add cursor movement to IO.ANSI (#7396) 2018-02-28 01:44:34 +01:00
Unai Esteibar 699231dcad Don't remove docs for previous function declaration on @impl true (#7383) 2018-02-23 20:31:36 +01:00
Aleksei Magusev fa1191be8a Handle nested bitstring pattern matching failures in a better way (#7370) 2018-02-20 23:43:14 +01:00
jvf 2f03f4603e Fix DynamicSupervisor handling of extra arguments on child restart (#7371)
Fixes #7369
2018-02-20 12:33:24 +01:00
José Valim 5405a165d8 Do not raise if switches option finds an undefined switch
Otherwise the code may fail or not depending on the modules
loaded. The current code simply ignores whatever it is not
listed.

This commit also refactored the docs and tests.
2018-02-20 12:22:12 +01:00
Unai Esteibar 33306d7313 Deprecate dynamic mode in OptionParser and promote strict (#7366)
Fixes #7278
2018-02-20 10:32:51 +01:00
Boris 68b88ce9eb Make typespec declarations return :ok (#7364)
This aligns the behaviour of typespec module attributes with other module attributes.
2018-02-19 09:11:25 -08:00
José Valim 0ae082de54 Support perfect timing matches in stream tests 2018-02-14 10:25:35 +01:00
José Valim 43f959a09a Delete only @echo instead of the whole tmp dir to avoid races on Windows 2018-02-14 09:48:05 +01:00
Andrea Leopardi f30b29aca1 Prevent operators with many of same char to have same char after them (#7344) 2018-02-14 09:43:55 +01:00
Andrea Leopardi 44f87e1336 Silence the Module.add_doc/6 deprecation in tests (#7345) 2018-02-13 14:53:26 -08:00
Aleksei Magusev 2d4be9850b Support negative dates in Calendar (#6638) 2018-02-11 09:44:32 +01:00
Aleksei Magusev ff5594332a Improve test names for inspect/1 with calendar data types 2018-02-10 20:41:28 +01:00
José Valim 2cbd5cee83 Ensure -> does not pass line lengths, closes #7279 2018-02-10 20:37:59 +01:00
José Valim b8bf33beff Bring add_doc/6 back, closes #7335 2018-02-10 11:07:19 +01:00
José Valim 7e0acd983a Consistently raise for missing do option in definitions
Closes #7333.
2018-02-09 17:05:59 +01:00
José Valim ae8502d8cd Use tags on windows/unix and allow failures on appveyor (#7320) 2018-02-08 12:44:09 +01:00
José Valim 0bed0d01cb Add DynamicSupervisor.stop and streamline event manager code 2018-02-08 12:15:24 +01:00
José Valim cf7f2e493c Restart contextual vars on function definitions 2018-02-03 23:21:30 -02:00
Michał Muskała 77c9d4872d Use contextual vars for __CALLER__ (#7309) 2018-02-03 23:10:40 -02:00
Michał Muskała 097de7d308 Introduce __STACKTRACE__ (#7134) 2018-02-03 14:09:47 -02:00
José Valim 84dcbbb4d1 Revert "Do not change argument evaluation semantics in bind_quoted (#7298)"
This reverts commit 7c142fbc86.

This causes a build failure on Erlang 19.
2018-02-03 10:57:40 -02:00
José Valim 7c142fbc86 Do not change argument evaluation semantics in bind_quoted (#7298) 2018-02-01 14:08:47 -02:00
José Valim d8a57371d4 Properly format warning_test.exs 2018-02-01 14:08:10 -02:00
José Valim 83c2791263 Do not change code invocation semantics in guards 2018-02-01 11:38:09 -02:00
José Valim 1d0ac1caac Do not warn for underscored var access from quoted contexts 2018-02-01 11:02:04 -02:00