Lukas Wirth
ce5046be50
Run codegen commands as tests if their results are commited
2024-07-07 09:14:50 +02:00
Lukas Wirth
986b9cf022
Move feature-doc generation to xtask codegen
2024-07-07 09:00:18 +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
e2daee61bc
test: add test for float_split_scientific_notation
2024-03-06 22:51:22 +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
Lukas Wirth
ccccc299c8
fix: Recover from =
in record constructor field assignment
2024-02-13 18:23:33 +01:00
Tetsuharu Ohzeki
f474bd77be
parser: Fix warnings about clippy str_to_string
rule
2024-02-10 01:00:40 +09:00
Lukas Wirth
974e69b0c5
Recover from missing slots in delimited parsing
2024-02-08 11:14:37 +01:00
Yutaro Ohno
e865d45904
fix: Recover from missing argument in call expressions
...
Previously, when parsing an argument list with a missing argument (e.g.,
`(a, , b)` in `foo(a, , b)`), the parser would stop upon an unexpected
token (at the second comma in the example), resulting in an incorrect
parse tree.
This commit improves error handling in such cases, ensuring a more
accurate parse tree is built.
2024-02-08 10:54:04 +01:00
bors
66cec4d11a
Auto merge of #16470 - Veykril:clippy-disallow, r=lnicola
...
internal: Lint debug prints and disallowed types with clippy
2024-02-05 17:20:43 +00:00
Young-Flash
864c3d5880
test: add method_call_missing_argument_list error test
2024-02-05 17:54:09 +08:00
Young-Flash
c495e3f00f
fix: emit parser error for missing argument list
2024-02-05 17:54:09 +08:00
Lukas Wirth
9e8a0fae0c
Lint debug prints and disallowed types with clippy
2024-02-01 17:57:27 +01:00
Laurențiu Nicola
f43cea0878
Merge commit '7219414e81810fd4d967136c4a0650523892c157' into sync-from-ra
2024-01-28 15:56:54 +02:00
Lukas Wirth
8a5829cf28
Re-order mod declarations
2024-01-27 11:02:34 +01:00
Laurențiu Nicola
b1b6e0c41a
Reapply "Detect NulInCStr
error earlier."
...
This reverts commit 0ea056552a
.
2024-01-25 06:40:07 +02:00
Nicholas Nethercote
858f4aca6c
Rename the unescaping functions.
...
`unescape_literal` becomes `unescape_unicode`, and `unescape_c_string`
becomes `unescape_mixed`. Because rfc3349 will mean that C string
literals will no longer be the only mixed utf8 literals.
2024-01-25 12:28:11 +11:00
Laurențiu Nicola
e4866b6ddb
Merge commit 'a9116523604c998e7781f60d3b5a6f586e0414a9' into sync-from-ra
2024-01-21 16:53:06 +02:00
Johann Hemmann
6709eaba2a
never_loop
2024-01-19 17:31:01 +01:00
Johann Hemmann
b599de193f
Refactor macro_call
to be consistent with other functions
2024-01-18 12:50:36 +01:00
bors
1ab8c7fd27
Auto merge of #16349 - Young-Flash:use_error_recovery, r=Veykril
...
fix: add error recovery for use_tree_list parsing
This PR adds error recovery for USE_TREE_LIST parsing, avoid the wrong USE_TREE_LIST making the rest parsing incorrectly.
before
![before](https://github.com/rust-lang/rust-analyzer/assets/71162630/c6643690-f25c-4ad9-93d9-e661ba5b1dc3 )
after
![after](https://github.com/rust-lang/rust-analyzer/assets/71162630/30a58c40-2711-48d2-b2e5-fb208fc8636c )
close https://github.com/rust-lang/rust-analyzer/issues/16227
2024-01-18 09:52:37 +00:00