aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar.rs
diff options
context:
space:
mode:
authorEvgenii P <[email protected]>2019-08-09 10:08:36 +0100
committerEvgenii P <[email protected]>2019-08-09 10:08:36 +0100
commitfa24e20867893178ed7265ecadb2bcb09cf76dac (patch)
tree40db0d5e514bf1d260aa21a3a305b37986136481 /crates/ra_parser/src/grammar.rs
parent957b5ed23a4860fe3c9b80687a801b5d7870fe00 (diff)
Make name_ref to accept numeric names optionally
Diffstat (limited to 'crates/ra_parser/src/grammar.rs')
-rw-r--r--crates/ra_parser/src/grammar.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs
index 00fb1bac9..2ee121ccd 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) { 276fn name_ref(p: &mut Parser, allow_numeric_names: bool) {
277 if p.at(IDENT) || p.at(INT_NUMBER) { 277 if p.at(IDENT) || (allow_numeric_names && p.at(INT_NUMBER)) {
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);