From d334b5a1db9ec6a57f54077d422a3f4b3c8c1178 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 21 Feb 2019 13:27:45 +0300 Subject: move parser to a separate crate --- crates/ra_syntax/src/parsing/grammar/type_args.rs | 48 ----------------------- 1 file changed, 48 deletions(-) delete mode 100644 crates/ra_syntax/src/parsing/grammar/type_args.rs (limited to 'crates/ra_syntax/src/parsing/grammar/type_args.rs') diff --git a/crates/ra_syntax/src/parsing/grammar/type_args.rs b/crates/ra_syntax/src/parsing/grammar/type_args.rs deleted file mode 100644 index f889419c5..000000000 --- a/crates/ra_syntax/src/parsing/grammar/type_args.rs +++ /dev/null @@ -1,48 +0,0 @@ -use super::*; - -pub(super) fn opt_type_arg_list(p: &mut Parser, colon_colon_required: bool) { - let m; - match (colon_colon_required, p.nth(0), p.nth(1)) { - (_, COLONCOLON, L_ANGLE) => { - m = p.start(); - p.bump(); - p.bump(); - } - (false, L_ANGLE, _) => { - m = p.start(); - p.bump(); - } - _ => return, - }; - - while !p.at(EOF) && !p.at(R_ANGLE) { - type_arg(p); - if !p.at(R_ANGLE) && !p.expect(COMMA) { - break; - } - } - p.expect(R_ANGLE); - m.complete(p, TYPE_ARG_LIST); -} - -// test type_arg -// type A = B<'static, i32, Item=u64>; -fn type_arg(p: &mut Parser) { - let m = p.start(); - match p.current() { - LIFETIME => { - p.bump(); - m.complete(p, LIFETIME_ARG); - } - IDENT if p.nth(1) == EQ => { - name_ref(p); - p.bump(); - types::type_(p); - m.complete(p, ASSOC_TYPE_ARG); - } - _ => { - types::type_(p); - m.complete(p, TYPE_ARG); - } - } -} -- cgit v1.2.3