diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-30 16:40:16 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-30 16:40:16 +0000 |
commit | c0d1b17a4e976e07966a1d7f545b6e01d278fd08 (patch) | |
tree | e81324b7cfcb4822d247e4a08c164f8e606477fc /crates/ra_syntax/src | |
parent | 942c45a31c4ffcf544362c8068360cac49627032 (diff) | |
parent | 53c94e3ad8782b2ab51bea1aeb5687ec34f7a96d (diff) |
Merge #366
366: parse minus before number literal pattern r=matklad a=csmoe
r?@matklad
![unknown](https://user-images.githubusercontent.com/35686186/50547871-d5449e00-0c7d-11e9-9ff5-1031e78019de.png)
Co-authored-by: csmoe <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r-- | crates/ra_syntax/src/grammar/patterns.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/grammar/patterns.rs b/crates/ra_syntax/src/grammar/patterns.rs index 64cdf0b1b..692ffbb8c 100644 --- a/crates/ra_syntax/src/grammar/patterns.rs +++ b/crates/ra_syntax/src/grammar/patterns.rs | |||
@@ -48,11 +48,16 @@ fn atom_pat(p: &mut Parser, recovery_set: TokenSet) -> Option<CompletedMarker> { | |||
48 | // test literal_pattern | 48 | // test literal_pattern |
49 | // fn main() { | 49 | // fn main() { |
50 | // match () { | 50 | // match () { |
51 | // -1 => (), | ||
51 | // 92 => (), | 52 | // 92 => (), |
52 | // 'c' => (), | 53 | // 'c' => (), |
53 | // "hello" => (), | 54 | // "hello" => (), |
54 | // } | 55 | // } |
55 | // } | 56 | // } |
57 | if p.at(MINUS) && (p.nth(1) == INT_NUMBER || p.nth(1) == FLOAT_NUMBER) { | ||
58 | p.bump(); | ||
59 | } | ||
60 | |||
56 | if let Some(m) = expressions::literal(p) { | 61 | if let Some(m) = expressions::literal(p) { |
57 | return Some(m); | 62 | return Some(m); |
58 | } | 63 | } |