Commit graph

298 commits

Author SHA1 Message Date
Ryo Yoshida
0d4d1d7e3b
Implement ${count()} metavariable expression 2023-05-28 19:54:36 +09:00
Lukas Wirth
90499d4390 Use boxed slices instead ovecs in decl macros 2023-05-02 17:04:53 +02:00
Lukas Wirth
d1ca505525 fix: Fix pat fragment handling in 2021 edition 2023-04-24 22:21:37 +02:00
Jake Heinz
a497e9a05e mbe: fix token conversion for doc comments 2023-04-22 03:06:06 +00:00
bors
2400b36a2e Auto merge of #14577 - jsoref:spelling, r=lnicola
Spelling

This PR corrects misspellings identified by the [check-spelling action](https://github.com/marketplace/actions/check-spelling).

The misspellings have been reported at https://github.com/jsoref/rust-analyzer/actions/runs/4699991040#summary-12751355796

The action reports that the changes in this PR would make it happy: https://github.com/jsoref/rust-analyzer/actions/runs/4699991284#summary-12751356293

closes #14567
2023-04-19 14:05:40 +00:00
Josh Soref
bc7d84c3ce Spelling
* a rule
* access
* after
* amount
* annotations
* assignment
* assist
* associated
* attribute
* borrowed
* built-in type
* clarification
* command
* const
* constructor
* corresponding
* counterparts
* curlies
* dependencies
* deterministic
* diagnostic
* duplicates
* edge
* edited
* efficient
* elsewhere
* execution
* expression
* extensions
* extracted
* fill
* github
* helper
* heuristic
* incomplete
* indent end
* inlay
* invocation
* lifetime
* looking
* maybe
* move
* mutability
* mutable
* necessarily
* necessary
* negative
* nonexistent
* occurred
* offsets
* offsetted
* overridden
* parameters
* params
* params_and_where_preds_in_scope
* paredit
* parent
* parentheses
* prepended if
* punctuation
* receive
* receiver
* referring
* repeated
* representing
* semantically
* separately
* shouldnot
* siblings
* similar
* something's
* statement
* struct
* structure
* surprise
* the
* this
* transparent
* unimplemented
* unnamed
* unnecessary
* unneeded
* unreachable
* unterminated
* utilities
* variant
* variants
* visibility
* work around (v)
* workaround

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-19 09:45:55 -04:00
Lukas Wirth
a2a3fecae3 Option begone part 2 2023-04-16 19:20:48 +02:00
Lukas Wirth
71b50f9f09 Record eager expansion errors in EagerCallInfo 2023-04-16 16:11:59 +02:00
Lukas Wirth
3c0f20a7bd internal: Enable smallvec's union feature 2023-02-14 17:01:01 +01:00
Lukas Wirth
a756c9ad08 Fixup comments 2023-02-07 18:08:05 +01:00
Lukas Wirth
e59487de38 Add tests for float access macro call inputs 2023-02-07 17:12:24 +01:00
Lukas Wirth
c6e7917d6e Fix up token_tree_to_syntax_node float split handling 2023-02-07 15:21:37 +01:00
Lukas Wirth
9053bcc65c Make mbe compile with parser changes 2023-02-03 21:39:24 +01:00
Lukas Wirth
41a46a78f2 Make tt generic over the span data 2023-01-31 14:58:16 +01:00
bors
fa874627f0 Auto merge of #13969 - Veykril:workspace.dependencies, r=Veykril
Use workspace.dependencies to declare local dependencies
2023-01-17 10:29:27 +00:00
Lukas Wirth
bed4db3c62 Use workspace.dependencies to declare local dependencies 2023-01-17 10:52:26 +01:00
Lukas Wirth
e4858fe480 Specify authors, edition and license via workspace.package 2023-01-16 16:44:00 +01:00
Lukas Wirth
679df2adf1 Specify rust-version via workspace.package 2023-01-16 16:33:01 +01:00
bors
f32f64bffc Auto merge of #13929 - danieleades:simplify, r=lnicola
internal: a number of code simplifications
2023-01-11 09:38:34 +00:00
Daniel Eades
ac3844a0bb a number of code simplifications 2023-01-10 18:48:51 +00:00
Daniel Eades
95d14c393c avoid 'cloning' types that implement 'Copy' 2023-01-10 18:20:12 +00:00
Daniel Eades
4f8ffd0ba4 remove unnecessary lifetimes that can be elided 2023-01-02 15:02:54 +00:00
Daniel Eades
efd2c20e96 remove useless conversions 2023-01-02 15:02:54 +00:00
Daniel Eades
cc80c5bd07 remove unnecessary lazy evaluations 2023-01-02 15:02:54 +00:00
Daniel Eades
ed128872eb remove needless borrows 2023-01-02 14:52:32 +00:00
Ryo Yoshida
a7d411425c
mbe: handle multi-character separator 2022-12-28 00:59:56 +09:00
Ryo Yoshida
767351fb87
mbe: treat <- as one punct 2022-12-27 18:34:46 +09:00
Ryo Yoshida
ec7148b091
mbe: split Op::Leaf and handle multi-character puncts 2022-12-27 18:23:01 +09:00
Ryo Yoshida
47c6c8e2f3
Extract multi-character punct handling into a method 2022-12-27 18:21:01 +09:00
Yuri Astrakhan
e16c76e3c3 Inline all format arguments where possible
This makes code more readale and concise,
moving all format arguments like `format!("{}", foo)`
into the more compact `format!("{foo}")` form.

The change was automatically created with, so there are far less change
of an accidental typo.

```
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2022-12-24 14:36:10 -05:00
Ryo Yoshida
e027ac0fbf
fix: don't let mbe expr fragments match let exprs and inline consts 2022-12-20 20:31:47 +09:00
bors
6f313cef8e Auto merge of #13548 - lowr:fix/tt-punct-spacing, r=Veykril
Fix `tt::Punct`'s spacing calculation

Fixes #13499

We currently set a `tt::Punct`'s spacing to `Spacing::Joint` unless its next token is a trivia (i.e. whitespaces or comment). As I understand it, rustc only [sets `Spacing::Joint` if the next token is an operator](5b3e909075/compiler/rustc_parse/src/lexer/tokentrees.rs (L77-L78)) and we should follow it to guarantee the consistent behavior of proc macros.
2022-11-11 12:19:30 +00:00
Lukas Wirth
ffd7bf8bf9 Bump Cargo rust-version fields to latest stable 2022-11-07 12:59:51 +01:00
Ryo Yoshida
41b0c54c07
Fix tt::Punct's spacing calculation 2022-11-05 19:42:09 +09:00
Ryo Yoshida
b87a23b91b
Rename convertor -> converter 2022-11-05 19:41:08 +09:00
bors
855cd5c280 Auto merge of #13418 - lnicola:bump-deps, r=lnicola
Bump deps
2022-10-15 11:27:12 +00:00
Laurențiu Nicola
50f990c46f Bump smallvec 2022-10-15 12:52:34 +03:00
Lukas Wirth
78f33c0e96 Expand unmatched mbe fragments to reasonable default token trees
Currently we expand unmatched fragments by not replacing them at all,
leaving us with `$ident`. This trips up the parser or subsequent macro
calls. Instead it makes more sense to replace these with some reasonable
default depending on the fragment kind which should make more recursive
macro calls work better for completions.
2022-10-10 14:27:05 +02:00
Jonas Platte
c4a87ee0ce
mbe: Remove unneeded unwrap 2022-09-14 23:49:08 +02:00
Jonas Platte
d6f0fd04ee
mbe: Remove unnecessary reference to usize 2022-09-14 23:42:11 +02:00
Jonas Platte
54305545a5
mbe: Remove Vec reference in container 2022-09-14 23:35:12 +02:00
Jonas Platte
b6aed7914d
mbe: Remove double reference in container 2022-09-14 23:30:44 +02:00
Jonas Platte
f7f6d2870f
mbe: Use extend instead of push in loop 2022-09-14 23:26:24 +02:00
Jonas Platte
5e2f9e322f
mbe: Return Bindings from build_inner 2022-09-14 23:22:38 +02:00
Dezhi Wu
23747419ca fix: a bunch of typos
This PR will fix some typos detected by [typos].

There are also some other typos in the function names, variable names, and file
names, which I leave as they are. I'm more certain that typos in comments
should be fixed.

[typos]: https://github.com/crate-ci/typos
2022-08-17 21:44:58 +08:00
Edwin Cheng
23e17cd581 Improve insert whitespace in mbe 2022-08-10 16:28:56 +08:00
Amos Wenger
816f7fe12a Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
Amos Wenger
23d25a3094 Enable extra warnings required by rust-lang/rust 2022-07-20 15:00:17 +02:00
Florian Diebold
0a4065d12d Improve syntax fixup a bit, handle incomplete if
- allow appending tokens after a token, not just a node
- allow inserting delimiters (and remove them again)
- fix up `if {}` and `if` without anything following
2022-07-16 13:03:32 +02:00
Jonas Schievink
df66eb74ab Implement ignore and index metavar expression 2022-07-11 18:31:42 +02:00