José Valim
80af632a7e
Wrap (a -> b) into literals instead of plain lists, closes #13358
2024-02-24 22:48:05 +01:00
José Valim
514615d034
Apply end of expression more consistently, closes #13355
2024-02-18 11:25:19 +01:00
José Valim
6655d40376
Streamline and document the parser
2024-02-07 15:06:48 +01:00
José Valim
d68c8d6cdd
Unify handling of .. and ...
2024-02-07 12:26:39 +01:00
José Valim
d244eaf8be
Remove end_of_expression from ->, closes #13318
2024-02-06 13:46:46 +01:00
José Valim
fd4e6b530c
Fix column marker for maps
2024-02-05 15:13:31 +01:00
Mitchell Hanberg
eb1499ac29
Include from_brackets metadata in all cases ( #13317 )
2024-02-05 09:40:16 +01:00
José Valim
1b6fb26dfb
Let's not deprecate ...foo as the API may be useful
...
for the type system in the future.
This reverts commit f97d8585e8 .
2023-11-10 12:36:04 +01:00
José Valim
5225b33bab
Add interpolation token metadata
2023-09-17 22:46:26 +02:00
Jean Klingler
a7edd6ea47
Parser honors :static_atoms_encoder for multi-letter sigils ( #12706 )
...
* Unify sigil token generation
* Parser honors :static_atoms_encoder for multi-letter sigils
* Remove chars from token, reverse engineer from atom
2023-06-24 18:29:24 +09:00
José Valim
50266c48e4
Fix regression on grammar, closes #12579
2023-05-22 16:15:04 +02:00
Andrea Leopardi
c402e8336c
Add support for multi-letter uppercase sigils ( #12448 )
2023-03-05 13:10:28 -06:00
José Valim
9e846dd0a4
Remove outdated TODO
2023-02-21 16:30:22 +01:00
JP Ramassini
aa8e6d3feb
Add error message when piping into an expression ending in bracket-based access ( #12359 )
...
Closes #12351 .
2023-01-23 21:43:42 +01:00
José Valim
d86916cae8
Improve error message for {foo: :bar} and <<foo: :bar>>
2023-01-19 00:09:40 +01:00
José Valim
7b73407af8
Respect line breaks after =
...
Many editors use indentation for collapsing
so folks may want to use `var =` followed by
new line to collapse. This PR makes it possible
and aligns `=` with other operators.
2023-01-04 12:06:58 +01:00
José Valim
3186819506
Apply rearrange ops only inside parens, closes #12296
2022-12-10 19:27:26 +01:00
sabiwara
7ebfcc7de9
Fix formatter error on nested do without parenthesis ( #12274 )
2022-11-27 15:15:18 +01:00
José Valim
ef5916bb67
Refactor and normalize format
2022-10-27 23:29:09 +02:00
José Valim
8f57c0ed1b
Update notes on |
2022-10-25 10:36:40 +02:00
José Valim
0a1a5991d9
Remove unecessary parens in nullary type funs
2022-10-14 13:55:23 +02:00
José Valim
9fb3cf6030
Fix ambiguity in &INT with brackets
2022-10-08 10:52:37 +02:00
José Valim
9aca91ce06
Improve error message for too many arguments in access
2022-09-27 17:51:23 +02:00
José Valim
29ed6925b3
Warn for nested calls without parens inside keywords
2022-09-24 16:50:07 +02:00
José Valim
3ee1e83eef
Remove parser ambiguity within stepped ranges
2022-09-10 00:32:13 +02:00
José Valim
f97d8585e8
Deprecate ... as a valid function call identifier
2022-08-15 15:10: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
d93577ecfa
Clarify what the correct xor precedence should have been
2022-04-16 13:50:35 +02:00
José Valim
b52f274406
Add .. as a nullary operator that returns 0..-1//1 ( #11623 )
2022-02-13 15:18:53 +01:00
Michał Łępicki
9e898f8b5a
Remove references to HiPE ( #11543 )
...
* Fix typo in Dialyzer CI step name
* Remove references to HiPE
2022-01-05 13:37:17 +01:00
José Valim
8c2ec72875
Do not emit warnings on Cursor.Fragment.container_cursor_to_quoted/2
2021-12-16 16:13:39 +01:00
José Valim
acbc04a902
Warn on trailing commas on calls, closes #11399
2021-11-19 11:46:46 +01:00
José Valim
65ab34224f
Include column in warnings emitted by compiler ( #11339 )
...
We also extend Mix.Tasks.Compiler.Diagnostic
to include {line, column} as possible position.
We also explicitly document the behaviour of
line=0, which is equivalent to unknown line.
Elixir was already setting the line to zero in
multiple occasions prior to this patch, so this
patch makes it official and we stop returning `nil`
for said cases.
2021-10-24 16:28:36 +02:00
José Valim
f2bd03273f
Include column in more errors whenever possible
2021-10-24 15:58:19 +02:00
José Valim
e480151fe7
Add Code.Fragment.container_cursor_to_quoted/2 ( #11315 )
2021-10-16 15:12:09 +02:00
José Valim
7a9a00d9e2
Add power operator ( #11241 )
2021-09-14 11:08:34 +02:00
José Valim
1789c1eb9b
Handle OP/ARITY syntax more consistently
2021-08-27 21:39:14 +02:00
Dorgan
1c8ba7489d
Preserve heredoc indentation metadata ( #11128 )
2021-07-20 08:16:21 +02:00
Dorgan
41dd2ab9f4
Add more token metadata to aliases and remote calls ( #11038 )
2021-06-05 19:22:40 +02:00
José Valim
b44bbe536c
Do not assume that literals in blocks have been normalized
2021-05-27 13:15:46 +02:00
José Valim
effa61ac96
Improve error message for expression after keyword
...
For maps and lists:
$ elixir -e "%{foo: :bar, :baz => :bat}"
** (SyntaxError) nofile:1: unexpected expression after keyword list. Keyword lists must always come last in lists and maps. Therefore, this is not allowed:
[some: :value, :another]
%{some: :value, another => value}
Instead, reorder it to be the last entry:
[:another, some: :value]
%{another => value, some: :value}
Syntax error after: ','
(elixir 1.13.0-dev) lib/code.ex:655: Code.eval_string_with_error_handling/3
For calls:
$ elixir -e "call foo: :bar, :baz"
** (SyntaxError) nofile:1: unexpected expression after keyword list. Keyword lists must always come as the last argument. Therefore, this is not allowed:
function_call(1, some: :option, 2)
Instead, wrap the keyword in brackets:
function_call(1, [some: :option], 2)
Syntax error after: ','
(elixir 1.13.0-dev) lib/code.ex:655: Code.eval_string_with_error_handling/3
Closes #10973 .
2021-05-12 13:34:06 +02:00
José Valim
a1989d01f8
Respect keywords in access in code formatter
2021-05-11 12:37:52 +02:00
José Valim
6055a7eb2c
Allow unquote_splicing inside maps with no parens
2021-05-04 23:59:38 +02:00
José Valim
a080002de9
Improve warnings
2021-03-26 13:19:04 +01:00
José Valim
b849235472
Support stepped ranges ( #10810 )
2021-03-25 07:32:06 +01:00
José Valim
c9a171da5b
Deprecate ^^^
2021-03-23 10:23:58 +01:00
José Valim
9da5cb8b9e
Rewrite not (foo in bar) to foo not in bar
2021-03-07 20:00:08 +01:00
José Valim
ae3ef6732c
Generalize operator completion on IEx' parser
2021-02-12 14:19:31 +01:00
Eksperimental
6944a67965
Revise use of Note and Notice verbs ( #10264 )
2020-08-14 07:59:34 +02:00
José Valim
cd2ed7c7cf
Revert "Consistently handle empty blocks"
...
Actually, we don't allow `-> [EMPTY]` anywhere else.
This reverts commit 00a6401f3f .
2020-06-25 12:32:07 +02:00