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 <csmoe@msn.com>
This commit is contained in:
bors[bot] 2018-12-30 16:40:16 +00:00
commit c0d1b17a4e
3 changed files with 51 additions and 33 deletions

View file

@ -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);
}