diff options
author | Aleksey Kladov <[email protected]> | 2018-02-17 22:06:48 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-02-17 22:06:48 +0000 |
commit | c6f4a06b4297f498da4bc2cd747aa38effb855b0 (patch) | |
tree | a383a2e71da6029bbd6a5669b5f9d2b99a1b0a92 /src/parser/grammar/expressions.rs | |
parent | 8c4c5b5b802a204bfeef52e215358ae838900f1f (diff) |
G: value_parameters, patterns & let statement
Diffstat (limited to 'src/parser/grammar/expressions.rs')
-rw-r--r-- | src/parser/grammar/expressions.rs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/parser/grammar/expressions.rs b/src/parser/grammar/expressions.rs index 3704cb16f..2145b8d8b 100644 --- a/src/parser/grammar/expressions.rs +++ b/src/parser/grammar/expressions.rs | |||
@@ -14,7 +14,20 @@ pub(super) fn literal(p: &mut Parser) -> bool { | |||
14 | } | 14 | } |
15 | 15 | ||
16 | pub(super) fn expr(p: &mut Parser) { | 16 | pub(super) fn expr(p: &mut Parser) { |
17 | if !literal(p) { | 17 | if literal(p) { |
18 | p.error("expected expression"); | 18 | return; |
19 | } | 19 | } |
20 | |||
21 | match p.current() { | ||
22 | L_PAREN => tuple_expr(p), | ||
23 | _ => p.error("expected expression"), | ||
24 | } | ||
25 | } | ||
26 | |||
27 | fn tuple_expr(p: &mut Parser) { | ||
28 | assert!(p.at(L_PAREN)); | ||
29 | let m = p.start(); | ||
30 | p.expect(L_PAREN); | ||
31 | p.expect(R_PAREN); | ||
32 | m.complete(p, TUPLE_EXPR); | ||
20 | } | 33 | } |