diff options
Diffstat (limited to 'src/grammar')
-rw-r--r-- | src/grammar/expressions/mod.rs | 8 | ||||
-rw-r--r-- | src/grammar/params.rs | 8 | ||||
-rw-r--r-- | src/grammar/patterns.rs | 4 | ||||
-rw-r--r-- | src/grammar/types.rs | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/grammar/expressions/mod.rs b/src/grammar/expressions/mod.rs index 18e3f5798..e0b4ced74 100644 --- a/src/grammar/expressions/mod.rs +++ b/src/grammar/expressions/mod.rs | |||
@@ -68,8 +68,8 @@ fn current_op(p: &Parser) -> (u8, Op) { | |||
68 | if p.at_compound2(PIPE, PIPE) { | 68 | if p.at_compound2(PIPE, PIPE) { |
69 | return (3, Op::Composite(PIPEPIPE, 2)); | 69 | return (3, Op::Composite(PIPEPIPE, 2)); |
70 | } | 70 | } |
71 | if p.at_compound2(AMPERSAND, AMPERSAND) { | 71 | if p.at_compound2(AMP, AMP) { |
72 | return (4, Op::Composite(AMPERSANDAMPERSAND, 2)); | 72 | return (4, Op::Composite(AMPAMP, 2)); |
73 | } | 73 | } |
74 | if p.at_compound2(L_ANGLE, EQ) { | 74 | if p.at_compound2(L_ANGLE, EQ) { |
75 | return (5, Op::Composite(LTEQ, 2)); | 75 | return (5, Op::Composite(LTEQ, 2)); |
@@ -113,7 +113,7 @@ fn expr_bp(p: &mut Parser, r: Restrictions, bp: u8) { | |||
113 | 113 | ||
114 | const UNARY_EXPR_FIRST: TokenSet = | 114 | const UNARY_EXPR_FIRST: TokenSet = |
115 | token_set_union![ | 115 | token_set_union![ |
116 | token_set![AMPERSAND, STAR, EXCL], | 116 | token_set![AMP, STAR, EXCL], |
117 | atom::ATOM_EXPR_FIRST, | 117 | atom::ATOM_EXPR_FIRST, |
118 | ]; | 118 | ]; |
119 | 119 | ||
@@ -125,7 +125,7 @@ fn lhs(p: &mut Parser, r: Restrictions) -> Option<CompletedMarker> { | |||
125 | // let _ = &1; | 125 | // let _ = &1; |
126 | // let _ = &mut &f(); | 126 | // let _ = &mut &f(); |
127 | // } | 127 | // } |
128 | AMPERSAND => { | 128 | AMP => { |
129 | m = p.start(); | 129 | m = p.start(); |
130 | p.bump(); | 130 | p.bump(); |
131 | p.eat(MUT_KW); | 131 | p.eat(MUT_KW); |
diff --git a/src/grammar/params.rs b/src/grammar/params.rs index be985c80f..034542df1 100644 --- a/src/grammar/params.rs +++ b/src/grammar/params.rs | |||
@@ -53,10 +53,10 @@ fn self_param(p: &mut Parser) { | |||
53 | let la3 = p.nth(3); | 53 | let la3 = p.nth(3); |
54 | let n_toks = match (p.current(), la1, la2, la3) { | 54 | let n_toks = match (p.current(), la1, la2, la3) { |
55 | (SELF_KW, _, _, _) => 1, | 55 | (SELF_KW, _, _, _) => 1, |
56 | (AMPERSAND, SELF_KW, _, _) => 2, | 56 | (AMP, SELF_KW, _, _) => 2, |
57 | (AMPERSAND, MUT_KW, SELF_KW, _) => 3, | 57 | (AMP, MUT_KW, SELF_KW, _) => 3, |
58 | (AMPERSAND, LIFETIME, SELF_KW, _) => 3, | 58 | (AMP, LIFETIME, SELF_KW, _) => 3, |
59 | (AMPERSAND, LIFETIME, MUT_KW, SELF_KW) => 4, | 59 | (AMP, LIFETIME, MUT_KW, SELF_KW) => 4, |
60 | _ => return, | 60 | _ => return, |
61 | }; | 61 | }; |
62 | let m = p.start(); | 62 | let m = p.start(); |
diff --git a/src/grammar/patterns.rs b/src/grammar/patterns.rs index 770274686..d67f180fa 100644 --- a/src/grammar/patterns.rs +++ b/src/grammar/patterns.rs | |||
@@ -15,7 +15,7 @@ pub(super) fn pattern(p: &mut Parser) { | |||
15 | 15 | ||
16 | match la0 { | 16 | match la0 { |
17 | UNDERSCORE => placeholder_pat(p), | 17 | UNDERSCORE => placeholder_pat(p), |
18 | AMPERSAND => ref_pat(p), | 18 | AMP => ref_pat(p), |
19 | _ => p.err_and_bump("expected pattern"), | 19 | _ => p.err_and_bump("expected pattern"), |
20 | } | 20 | } |
21 | } | 21 | } |
@@ -108,7 +108,7 @@ fn placeholder_pat(p: &mut Parser) { | |||
108 | // let &mut b = (); | 108 | // let &mut b = (); |
109 | // } | 109 | // } |
110 | fn ref_pat(p: &mut Parser) { | 110 | fn ref_pat(p: &mut Parser) { |
111 | assert!(p.at(AMPERSAND)); | 111 | assert!(p.at(AMP)); |
112 | let m = p.start(); | 112 | let m = p.start(); |
113 | p.bump(); | 113 | p.bump(); |
114 | p.eat(MUT_KW); | 114 | p.eat(MUT_KW); |
diff --git a/src/grammar/types.rs b/src/grammar/types.rs index 565037cb0..9e63c9b2a 100644 --- a/src/grammar/types.rs +++ b/src/grammar/types.rs | |||
@@ -6,7 +6,7 @@ pub(super) fn type_(p: &mut Parser) { | |||
6 | EXCL => never_type(p), | 6 | EXCL => never_type(p), |
7 | STAR => pointer_type(p), | 7 | STAR => pointer_type(p), |
8 | L_BRACK => array_or_slice_type(p), | 8 | L_BRACK => array_or_slice_type(p), |
9 | AMPERSAND => reference_type(p), | 9 | AMP => reference_type(p), |
10 | UNDERSCORE => placeholder_type(p), | 10 | UNDERSCORE => placeholder_type(p), |
11 | FN_KW | UNSAFE_KW | EXTERN_KW => fn_pointer_type(p), | 11 | FN_KW | UNSAFE_KW | EXTERN_KW => fn_pointer_type(p), |
12 | FOR_KW => for_type(p), | 12 | FOR_KW => for_type(p), |
@@ -130,7 +130,7 @@ fn array_or_slice_type(p: &mut Parser) { | |||
130 | // type B = &'static (); | 130 | // type B = &'static (); |
131 | // type C = &mut (); | 131 | // type C = &mut (); |
132 | fn reference_type(p: &mut Parser) { | 132 | fn reference_type(p: &mut Parser) { |
133 | assert!(p.at(AMPERSAND)); | 133 | assert!(p.at(AMP)); |
134 | let m = p.start(); | 134 | let m = p.start(); |
135 | p.bump(); | 135 | p.bump(); |
136 | p.eat(LIFETIME); | 136 | p.eat(LIFETIME); |