mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-08 19:40:46 +00:00
Merge #366
366: parse minus before number literal pattern r=matklad a=csmoe r?@matklad  Co-authored-by: csmoe <csmoe@msn.com>
This commit is contained in:
commit
c0d1b17a4e
3 changed files with 51 additions and 33 deletions
|
@ -48,11 +48,16 @@ fn atom_pat(p: &mut Parser, recovery_set: TokenSet) -> Option<CompletedMarker> {
|
|||
// test literal_pattern
|
||||
// fn main() {
|
||||
// match () {
|
||||
// -1 => (),
|
||||
// 92 => (),
|
||||
// 'c' => (),
|
||||
// "hello" => (),
|
||||
// }
|
||||
// }
|
||||
if p.at(MINUS) && (p.nth(1) == INT_NUMBER || p.nth(1) == FLOAT_NUMBER) {
|
||||
p.bump();
|
||||
}
|
||||
|
||||
if let Some(m) = expressions::literal(p) {
|
||||
return Some(m);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue