Michael Goulet
8851e4fa39
Fix tools
2024-09-06 10:32:48 -04:00
Chayim Refael Friedman
21e6058ab7
Fix Return Type Syntax to include ..
(i.e. method(..)
and not method()
) as specified in the RFC
2024-08-26 01:45:52 +03:00
Chayim Refael Friedman
9d3368f2c2
Properly account for editions in names
...
This PR touches a lot of parts. But the main changes are changing
`hir_expand::Name` to be raw edition-dependently and only when necessary
(unrelated to how the user originally wrote the identifier),
and changing `is_keyword()` and `is_raw_identifier()` to be edition-aware
(this was done in #17896 , but the FIXMEs were fixed here).
It is possible that I missed some cases, but most IDE parts should properly
escape (or not escape) identifiers now.
The rules of thumb are:
- If we show the identifier to the user, its rawness should be determined
by the edition of the edited crate. This is nice for IDE features,
but really important for changes we insert to the source code.
- For tests, I chose `Edition::CURRENT` (so we only have to (maybe) update
tests when an edition becomes stable, to avoid churn).
- For debugging tools (helper methods and logs), I used `Edition::LATEST`.
2024-08-16 16:46:24 +03:00
Lukas Wirth
f90bdfc13d
internal: Properly check the edition for edition dependent syntax kinds
2024-08-15 15:57:47 +02:00
winstxnhdw
4a91453409
fix: move use
parsing to outer match arm
2024-07-23 22:36:46 +01:00
winstxnhdw
61b232369b
feat: add arm for use
type bound
2024-07-23 22:36:46 +01:00
Lukas Wirth
41603ab14e
Add missing dyn parse special cases in 2015 edition
2024-07-20 09:18:40 +02:00
Lukas Wirth
92f5e806f1
Fix edition used for include macro parsing
2024-07-19 20:29:53 +02:00
Lukas Wirth
f4199f786e
Parse contextual dyn keyword properly in edition 2015
2024-07-19 20:20:30 +02:00
Lukas Wirth
2c32ee7cfa
Prevent generated runner module from being format checked
2024-07-19 16:01:47 +02:00
Lukas Wirth
d235d09bf9
Parse try
as a keyword only in edition 2018 and up
2024-07-19 15:43:20 +02:00
Lukas Wirth
713c47f25b
Add basic edition inline parser test support
2024-07-19 15:19:43 +02:00
Lukas Wirth
7a5bf92b89
Rewrite inline parser test infra to generated proper rust test cases
2024-07-18 10:03:19 +02:00
Lukas Wirth
5264f86242
Encode edition within FileId in the hir layer
2024-07-18 08:49:10 +02:00
Lukas Wirth
92268627a8
Support rustc_skip_during_method_dispatch
2024-07-17 11:46:36 +02:00
Lukas Wirth
b8cac1bb6b
string is not a keyword
2024-07-17 11:11:57 +02:00
Lukas Wirth
7011094685
Add always disabled gen parse support
2024-07-17 10:49:12 +02:00
Lukas Wirth
983c9c122e
Derive kinds information from ungrammar file
2024-07-17 10:04:45 +02:00
Lukas Wirth
ce5046be50
Run codegen commands as tests if their results are commited
2024-07-07 09:14:50 +02:00
Lukas Wirth
5802643900
Move parser test generation to xtask
2024-07-07 08:51:19 +02:00
Lukas Wirth
013b6a883f
Fix up the syntax tree for macro 2.0
2024-07-03 10:41:19 +02:00
Lukas Wirth
21a3d01875
Remove inline rust_2018_idioms, unused_lifetimes
lint warn, Cargo.toml already enforces this
2024-06-30 15:23:54 +02:00
Lukas Wirth
f9bb5476c3
fix: Fix pat fragment parsers choking on <eoi>
2024-06-17 19:42:56 +02:00
Wilfred Hughes
d68e549205
internal: Fix rustdoc warnings
...
`cargo doc` generates a bunch of warnings on rust-analyzer. Fix all the
bare URL and empty code block warnings.
2024-06-13 17:29:10 -07:00
Wilfred Hughes
27182bb96b
chore: Prefer tracing span shorthand macros
2024-06-06 16:52:25 -07:00
Hamir Mahal
7c34eb3880
style: simplify string interpolation
2024-05-30 16:18:49 -07:00
Laurențiu Nicola
49cae17fa2
Merge from rust-lang/rust
2024-05-19 11:20:26 +03:00
Lukas Wirth
e1aeed3aed
Implement unsafe attribute parsing
2024-05-06 12:11:29 +02:00
Laurențiu Nicola
c8c635a3f8
Merge commit '55d9a533b309119c8acd13061581b43ae8840823' into sync-from-ra
2024-04-20 19:17:08 +03:00
davidsemakula
69fe457cb5
internal: simplify TokenSet
implementation
2024-04-15 17:33:09 +03:00
davidsemakula
e326b634d1
internal: add reserved keywords
2024-04-15 15:06:26 +03:00
davidsemakula
89779ca55e
internal: improve TokenSet
implementation
2024-04-15 15:06:26 +03:00
Lukas Wirth
83370fe5d7
Use Edition::CURRENT
2024-04-14 15:30:29 +02:00
Lukas Wirth
9c75e9fa7d
Deduplicate Edition enum
2024-04-14 15:29:01 +02:00
Johann Hemmann
e7852803c5
Mark edition field as unused
2024-04-14 15:11:38 +02:00
Johann Hemmann
454e481422
Add edition to all parse
functions of the parser crate
2024-04-14 15:07:43 +02:00
Johann Hemmann
392538c830
Add edition to parser struct
2024-04-14 15:06:09 +02:00
Esteban Küber
8677ebbc73
Properly handle emojis as literal prefix in macros
...
Do not accept the following
```rust
macro_rules! lexes {($($_:tt)*) => {}}
lexes!(🐛 "foo");
```
Before, invalid emoji identifiers were gated during parsing instead of lexing in all cases, but this didn't account for macro expansion of literal prefixes.
Fix #123696 .
2024-04-10 23:19:27 +00:00
Lukas Wirth
dc4e5987a4
fix: Improve error recovery for match arms
2024-03-19 10:55:47 +01:00
bors
2397e7a887
Auto merge of #16787 - pksunkara:remove-macro-call-check, r=lnicola
...
Remove unncessary check for macro call
Since `macro_rules` is a contextual keyword, it is an `IDENT` token and thus `is_path_start` already identifies it correctly. You can tell the previous check is unnecessary because the relevant tests still pass.
2024-03-08 13:23:31 +00:00
bors
2b7b44bf27
Auto merge of #16786 - pksunkara:improve-readability, r=lnicola
...
internal: Improve readability of the parser code
The code is basically equivalent to the previous version, but it improves the readability by making it much more simpler and concise.
2024-03-08 12:21:18 +00:00
Pavan Kumar Sunkara
a838e44032
Remove unncessary check for macro call
2024-03-08 12:03:35 +00:00
Pavan Kumar Sunkara
2a41b2cd94
Improve readability of the parser code
2024-03-08 12:00:24 +00:00
Pavan Kumar Sunkara
b37ccfce44
Remove unused keyword from visibility recovery
2024-03-08 11:53:03 +00:00
roife
91d181feff
minor: fmt and clippy
2024-03-06 23:32:40 +08:00
roife
03420c330e
fix: panic when split float numbers in scientific notation
2024-03-06 22:50:50 +08:00
Lukas Wirth
4303e741de
Cleanup
2024-03-04 11:10:06 +01:00
Michael Goulet
3e4deab3d8
Add support for const and async trait bounds
2024-02-16 16:00:04 +00:00
Maybe Waffle
e146139957
Add support for become
expr/tail calls
2024-02-14 14:57:18 +00:00
Lukas Wirth
bf115a6064
fix: Recover from =
in record pattern field
2024-02-13 18:25:40 +01:00