From 678882d4f844135cc5df33de1f6da326ec96a78b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 8 Aug 2018 00:59:16 +0300 Subject: literal pattern --- src/grammar/patterns.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/grammar/patterns.rs b/src/grammar/patterns.rs index 36ead7561..f23addfa3 100644 --- a/src/grammar/patterns.rs +++ b/src/grammar/patterns.rs @@ -13,6 +13,18 @@ pub(super) fn pattern(p: &mut Parser) { return; } + // test literal_pattern + // fn main() { + // match () { + // 92 => (), + // 'c' => (), + // "hello" => (), + // } + // } + if expressions::literal(p).is_some() { + return; + } + match la0 { UNDERSCORE => placeholder_pat(p), AMP => ref_pat(p), -- cgit v1.2.3