Commit Graph
304 Commits
Author SHA1 Message Date
Vinícius Müller 9a74a73a00 Normalize hint labels (#12958) 2023-09-23 18:59:08 +02:00
Vinícius Müller 3111a5b78a Improve mismatched delimiter message (#12928) 2023-09-15 18:31:48 +02:00
José Valim 646577af50 Add opening_delimiter to token missing error 2023-09-15 18:18:09 +02:00
José Valim 9a3d1a0321 Include open_delimiter in TokenMissingError 2023-09-15 18:18:09 +02:00
Vinícius Müller 0349240827 Add MistmatchedDelimiterError (#12918) 2023-09-12 12:18:51 +02:00
Vinícius Müller 0d139c15df Save column information on start delimiter tokens (#12916) 2023-09-10 13:09:56 +02:00
José Valim 1a04a8216d Do not add extra newlines after hints 2023-06-24 17:05:50 +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 bacea2cef6 Keep capture operator on container cursor to quoted 2023-06-12 10:43:51 +02:00
José Valim 7711aa1919 Improve heredoc warning 2023-06-08 16:14:55 +02:00
Wojtek Mach 1e3341382f Fix Macro.to_string/1 and ExUnit diffs for multi-letter sigils (#12627) 2023-06-01 16:17:51 +02:00
José Valim ca0d6ad60c Keep operators and identifiers in container_cursor_to_quoted 2023-05-19 22:59:48 +02:00
José Valim d1d3a083cb Support operators in container_cursor_to_quoted 2023-05-19 20:46:39 +02:00
José Valim faf81cd92c Improve docs for fragments, keep previous lines in blocks 2023-05-18 22:33:47 +02:00
Wojtek Mach fb1f1830b0 Improve sigil SyntaxError (#12555)
Before this patch we had:

    iex(1)> ~Decimal"1"
    ** (SyntaxError) iex:1:1: invalid sigil name, it should be either a one-letter lowercase letter or a sequence of uppercase letters only~Decimal"1"

Now, it's:

    iex(1)> ~Decimal"1"
    ** (SyntaxError) iex:1:1: invalid sigil name, it should be either a one-letter lowercase letter or a sequence of uppercase letters only, got: ~Decimal"1"
2023-05-09 12:25:36 +02:00
José Valim 97d4cd624f Properly keep context in map update fragment: %{map | 2023-05-04 13:15:33 +02:00
Andrea Leopardi c402e8336c Add support for multi-letter uppercase sigils (#12448) 2023-03-05 13:10:28 -06:00
José Valim b24869687b Introduce mechanism to collect several errors in a module (#12275) 2022-11-28 15:40:30 +01:00
José Valim 386113af86 Include snippets in more syntax errors 2022-10-25 12:52:20 +02:00
José Valim e070d4fbf4 Use correct column in invalid alias terminator 2022-10-11 14:56:34 +02:00
José Valim 9fb3cf6030 Fix ambiguity in &INT with brackets 2022-10-08 10:52:37 +02:00
José Valim b7dd72f567 Improve error message for invalid % { syntax 2022-09-27 18:56:29 +02:00
José Valim 2a78d378cd Add TODOs 2022-08-23 08:53:38 +02:00
José Valim 8fc62b814e Add TODO related to ... 2022-07-25 09:31:21 +02:00
José Valim 03ffc663e7 Add autocompletion of binary modifiers in IEx
Macro.path/2 was added as a helper function for
traversing expressions and returning their context.
2022-07-09 17:06:04 +02:00
José Valim 410c468467 Remove outdated TODO 2022-06-19 23:00:10 +02:00
Udo Kramer 3b5718cc4c Fix typos (#11901) 2022-06-03 11:14:21 +02:00
José Valim 850c7ddfe4 Normalize unicode characters once in tokenizer 2022-05-23 12:14:39 +03:00
José Valim 25212f2db1 Do not attempt to suggest starting tokens
It is hard to suggest because it is not possible to
know if the user intended an operator, alias, or
identifier, so we can give incorrect feedback.
2022-05-23 12:14:39 +03:00
Luc Fueston 31cbdbd6e0 nfc and additional normalizations for identifiers (#11859)
* nfc by default
* suggest nfkc on unexpected tokens when nfkc would have worked
* support additional normalizations (just micro/mu for now)
* parser, formatter tests
* tweak Macro.inner_classify(atom) not to rely on not_nfc causing error
2022-05-23 09:44:44 +02:00
Colin Caine 26df5b827c Improve warning on quoted atoms, calls, and keywords (#11838)
The warning messages stated that an atom containing starting with a
number and containing only ASCII letters, numbers and underscores does
not require quoting, for example `:401`, but this is not the case; `:401` is a
syntax error, as is `:1a` and so on.

This commit changes the warning message to make clear that unquoted
atoms/calls and keywords must not start with a number.
2022-05-16 18:03:54 +02:00
José Valim 0fdca7b8ac Improve error message clarity 2022-03-23 18:48:42 +01:00
José Valim b52f274406 Add .. as a nullary operator that returns 0..-1//1 (#11623) 2022-02-13 15:18:53 +01:00
José Valim 2676f8b221 Allow only single- and highly restricted mixed-scripts in identifiers (UTS39 C3) (#11621) 2022-02-11 20:44:06 +01:00
José Valim bee0bb56be Do not emit warnings when formatting code
Closes #11595.
2022-01-26 13:37:53 +01:00
José Valim 851ac27272 Run unicode security linting on more tokens 2022-01-21 10:50:02 +01:00
Luc Fueston cba50b7a28 Warn on confusable non-ascii identifiers (UTS 39, C2) (#11582) 2022-01-21 09:37:25 +01:00
Paulo Daniel Gonzalez ef2e544749 Add nudge to do expression error (#11552)
Closes https://github.com/elixir-lang/elixir/issues/11551
2022-01-07 20:41:26 +01:00
José Valim a74d0cc390 Deprecate <|> 2021-12-13 20:13:03 +01:00
José Valim f1b9d3e818 Deprecate use Bitwise and ~~~
Use `import` instead.
2021-12-09 21:08:57 +01:00
José Valim a0ee96bd0e Warn on ::: to avoid ambiguity
The formatter already rewrote it to :"::" since
its conception.
2021-12-05 10:40:19 +01:00
José Valim 0a1e5eaf0a Do not print control chars as unexpected tokens 2021-11-26 21:02:07 +01:00
José Valim 5bb9633273 Reject bidirectional formatting characters (#11391) 2021-11-15 21:08:37 +01:00
José Valim 5bb865fab6 Handle more incomplete expressions in cursor_context_to_quoted 2021-10-24 17:22:01 +02: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 e480151fe7 Add Code.Fragment.container_cursor_to_quoted/2 (#11315) 2021-10-16 15:12:09 +02:00
sabiwara 0a26aa543b Tokenizer uses static_atoms_encoder on quoted keyword keys (#11313)
Closes #11312
2021-10-15 08:10:18 +02:00
José Valim f05ac0a9a4 Improve docs and remove unnecessary field 2021-10-06 21:28:07 +02:00
Danila Poyarkov 51ddee7b85 Allow sigil modifiers to contain digits (#11283) 2021-10-02 22:10:05 +02:00
José Valim 7a9a00d9e2 Add power operator (#11241) 2021-09-14 11:08:34 +02:00