aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-08-09 11:16:47 +0100
committerAleksey Kladov <[email protected]>2019-08-09 11:16:47 +0100
commitf3ee5a15090d8ba6ec220e1f907ed3af27e57734 (patch)
treed4042c35679ca1e4db06fd9976d90d025fca0966 /crates/ra_parser/src/grammar.rs
parent5f82012779c374d9f6b518634aefb14ce28e17e6 (diff)
Move numeric names inside of `NameRef`
Diffstat (limited to 'crates/ra_parser/src/grammar.rs')
-rw-r--r--crates/ra_parser/src/grammar.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs
index 2ee121ccd..beedac457 100644
--- a/crates/ra_parser/src/grammar.rs
+++ b/crates/ra_parser/src/grammar.rs
@@ -273,8 +273,8 @@ fn name(p: &mut Parser) {
273 name_r(p, TokenSet::empty()) 273 name_r(p, TokenSet::empty())
274} 274}
275 275
276fn name_ref(p: &mut Parser, allow_numeric_names: bool) { 276fn name_ref(p: &mut Parser) {
277 if p.at(IDENT) || (allow_numeric_names && p.at(INT_NUMBER)) { 277 if p.at(IDENT) {
278 let m = p.start(); 278 let m = p.start();
279 p.bump(); 279 p.bump();
280 m.complete(p, NAME_REF); 280 m.complete(p, NAME_REF);
@@ -287,6 +287,16 @@ fn name_ref(p: &mut Parser, allow_numeric_names: bool) {
287 } 287 }
288} 288}
289 289
290fn name_ref_or_index(p: &mut Parser) {
291 if p.at(IDENT) || p.at(INT_NUMBER) {
292 let m = p.start();
293 p.bump();
294 m.complete(p, NAME_REF);
295 } else {
296 p.err_and_bump("expected identifier");
297 }
298}
299
290fn error_block(p: &mut Parser, message: &str) { 300fn error_block(p: &mut Parser, message: &str) {
291 assert!(p.at(T!['{'])); 301 assert!(p.at(T!['{']));
292 let m = p.start(); 302 let m = p.start();