Commit Graph
3901 Commits
Author SHA1 Message Date
José Valim 2a374aee71 No longer auto-sort bindings 2021-02-24 15:39:33 +01:00
José Valim 85599242fd Update erlang test helper 2021-02-24 09:50:48 +01:00
José Valim 93adad7aa4 Remove duplicated tests 2021-02-24 09:40:56 +01:00
Wojtek Mach 68661dfa91 Support 16bit floats in bitstrings (#10740)
On OTP 24:

    iex> <<x::float-16>> = <<60, 0>>
    iex> x
    1.0
    iex> <<x::float-16>>
    <<60, 0>>

Before OTP 24 we'd get errors or wouldn't match:

    iex> <<1.0::float-16>>
    ** (ArgumentError) argument error while evaluating iex at line 1

    <<x::float-16>> = <<60, 0>>
    ** (MatchError) no match of right hand side value: <<60, 0>>

    iex> (fn <<x::float-16>> -> x; _ -> :nomatch end).(<<60, 0>>)
    :nomatch
2021-02-20 11:24:58 +01:00
Jonathan Arnett 88f596c20c Mark is_struct/2 code as generated (#10734) 2021-02-17 21:00:04 +01:00
victor felder 0264108b61 Fix Macro.underscore for digit preceded by capitals, closes #10713 (#10715) 2021-02-14 22:30:19 +01:00
José Valim 1155c06646 Revert "Do not support negative dates on the basic format"
This reverts commit b8537159ae.
2021-02-12 14:21:15 +01:00
Wojtek Mach 1ccb9c0060 Update Erlang warnings translation (#10694)
Since https://github.com/erlang/otp/commit/8ecc648df22dbfe9dd68a3e2b968ba2b6a2ca7fe
instead of `{eval_failure, Reason}` we'd get `{eval_failure, Call, Reason}`
2021-02-12 12:23:58 +01:00
José Valim b07e17679c Add export dependencies on Macro.struct! 2021-02-11 10:58:18 +01:00
Christopher Keele 6a15048e4e Support basic datetime format in Calendar.ISO parsing functions (#10693) 2021-02-08 22:58:32 +01:00
Christopher Keele cad4365de3 Rework Calendar.ISO parsing function tests and examples (#10692)
* Add ISO format examples to the top-level moduledocs.

* Move unit tests out of parse_time/1 documentation and into suite.

* Move unit tests out of parse_naive_datetime/1 documentation and into suite.

* Move unit tests out of parse_utc_datetime/1 documentation and into suite.

* Remove duplicated parse_date/1 doctests, fix missing asserts, other
cleanup.
2021-02-06 09:12:31 +01:00
José Valim b8537159ae Do not support negative dates on the basic format 2021-02-05 07:55:22 +01:00
Eksperimental 2202cc0c6b Fix context in defdelagate/2 AST (#10682)
Fixes #10593
2021-02-02 11:11:58 +01:00
Floris Huetink 40ece3b998 Add functions for RFC 3986 compliant space encoding and decoding (#10680) 2021-01-30 21:36:46 +01:00
Eksperimental 02c72c0f84 Standardize use of key-value pair (#10676) 2021-01-26 15:25:47 +01:00
José Valim c9d75cde09 Do not set the limit for derived inspect, closes #10669 2021-01-22 17:35:26 +01:00
José Valim 6117ae3cb0 Fix bug with slice returning invalid value for negative first value 2021-01-20 18:05:21 +01:00
Eric Meadows-Jönsson 5096fe4a33 Do not require RHS of and operator to be boolean (#10659)
Closes #10611.
2021-01-15 13:38:07 +01:00
sabiwara c39455a7b0 Make tap/2 and then/2 macros (#10658) 2021-01-15 11:19:26 +01:00
Eric Meadows-Jönsson db37fb6b67 Fix tuple subtype check (#10655)
Closes #10609.
2021-01-14 17:33:05 +01:00
José Valim c7d03ff45f Add System.trap_signal/3 and System.untrap_signal/2 (#10650) 2021-01-13 09:30:39 +01:00
Thiago Santos f8dfde6d3e Fix typos (#10639) 2021-01-09 23:09:41 +01:00
Ben Wilson 444b6093a4 Support compression on Registry (#10637) 2021-01-09 10:52:22 +01:00
José Valim b4f6f2a30c Remove rename_deprecated_at
We haven't added any new rules in a while and
we can assume that users relying on this option
have already rewritten (either manually or
automatically) the current deprecated calls.
2021-01-08 15:27:05 +01:00
Eksperimental c92a93be50 Fix cryptic error when defimpl is defined without :for option (#10620) 2021-01-04 07:50:34 +01:00
José Valim 1656bb2b04 Properly handle keywords followed by ::, closes #10599 2021-01-02 17:41:16 +01:00
José Valim 3207396e49 Support all literals in guards, closes #10613 2021-01-02 17:06:42 +01:00
José Valim c042528df6 Run the formatter 2021-01-02 17:05:25 +01:00
Julian Doherty 199d66ca2c Improve Enum.chunk_while/4 docs to clarify after_fun semantics (#10595)
- add `{:halt, acc}` tuple return doc for `chunk_fun`
- explain `after_fun` semantics in more detail
- format return tuples for `chunk_fun` and `after_fun` as markdown lists
- added note that `acc` in `after_fun` return tuple is ignored
- note that `Enum.chunk_while/4` returns a list of *chunks*, not a list
  of lists (emitted chunks can be anything, not necessarily just lists)
2021-01-02 16:29:20 +01:00
José Valim a94d5b80b5 Do not break inside interpolation
Closes #10587
2021-01-02 16:20:39 +01:00
Aleksei Matiushkin 33e41117ea Return :error on decomposing regular tuples as calls (#10612)
This makes two-elem and n-elem tuples consistent.
2020-12-31 10:12:58 +01:00
felipe stival 0ca409e4f5 Add Kernel.tap/2 (#10604) 2020-12-29 21:03:41 +01:00
Tomasz Marek Sulima ca5700678e Add Kernel.then/2 (#10603) 2020-12-29 20:58:41 +01:00
Adam Rutkowski 0ce0ed2229 Fix Path.relative_to/2 when referencing self (#10601)
If `relative_to` argument points at `path`, the
result should be relative.

Currently it's:

    iex(1)> Path.relative_to('/foo/bar', '/foo/bar') |> Path.type()
    :absolute

This patch fixes it, so it's:

    iex(1)> Path.relative_to('/foo/bar', '/foo/bar')
    "."
    iex(2)> Path.type(v(1))
    :relative

Similar code in python:

    In [1]: os.path.relpath('/foo/bar', start='/foo/bar')
    Out[1]: '.'

And in ruby:

    > Pathname.new('/foo/bar').relative_path_from(Pathname.new('/foo/bar')).to_s
    => "."
2020-12-29 12:57:02 +01:00
José Valim bad5844c92 Set evaluation to empty space to fix string replace on batch, closes #10495 (#10586) 2020-12-21 16:22:55 +01:00
John Bampton 0716ef4753 Fix spelling (#10583) 2020-12-17 16:08:42 +01:00
José Valim 7e84a615c1 Do not warn for attributes used in after_compile
Closes #10579.
2020-12-17 13:05:02 +01:00
José Valim b4f4cd433c Fix variable overriding in records, closes #10540 2020-12-13 09:05:03 +01:00
José Valim 5c63dfe68d Do not use unicode chars if ANSI is disabled
See https://github.com/elixir-lang/elixir/issues/10481#issuecomment-742448132
2020-12-10 12:18:39 +01:00
José Valim 0323dd2ac4 Improve error message on do-block in module attr, closes #10544 2020-12-10 12:12:14 +01:00
felipe stival 02b649090e Add Enum.product/1 (#10559) 2020-12-09 23:23:26 +01:00
Vicente Merlo fe1df769b9 Add offset option to Regex.scan/3 and Regex.run/3 (#10555) 2020-12-09 18:15:41 +01:00
felipe stival a979b882f9 Add support for functions on Enum.with_index/2 (#10552)
Makes Enum.with_index/2 supports both functions and offsets by setting
a default function (fn element, index -> {element, index} end) and
a default offset (0) and letting the user change one of them on the
second argument.
2020-12-09 15:35:19 +01:00
José Valim 49efee9cc1 Do not match on error_info on OTP 24 2020-12-08 17:40:13 +01:00
José Valim 316bd080d2 Take \r\n into account when computing heredoc indentation 2020-12-06 15:20:50 +01:00
Zach Daniel 15a2523db0 Add Enum.count_until/2 and Enum.count_until/3 (#10532) 2020-12-05 18:37:34 +01:00
Eksperimental 9605f19208 Use one-based generated arguments everywhere (#10523)
It complemments changes introduced in 3d0ef0a1a.
2020-12-02 18:02:34 +01:00
José Valim 3d0ef0a1a4 Use one-indexed args for clarity, closes #10518 2020-12-01 07:31:48 +01:00
José Valim 2b4b4943da Do not generate invalid code when formatting no args with when, closes #10508 2020-11-29 12:37:25 +01:00
José Valim 871c87cb55 Preserve CRLF for heredocs, closes #10504 2020-11-29 11:26:24 +01:00