aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/grammar
diff options
context:
space:
mode:
authorcsmoe <[email protected]>2018-12-30 13:51:40 +0000
committercsmoe <[email protected]>2018-12-30 15:25:07 +0000
commit53c94e3ad8782b2ab51bea1aeb5687ec34f7a96d (patch)
tree9eaaf088ff03c78df8a8a856bfdf586a017ba21d /crates/ra_syntax/src/grammar
parente422c2e2f4117cf977d28a40a9c8e4dc4cfee811 (diff)
parse minus before number literal
Diffstat (limited to 'crates/ra_syntax/src/grammar')
-rw-r--r--crates/ra_syntax/src/grammar/patterns.rs5
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 }