Move numeric names inside of NameRef

This commit is contained in:
Aleksey Kladov 2019-08-09 12:16:47 +02:00
parent 5f82012779
commit f3ee5a1509
10 changed files with 52 additions and 37 deletions

View file

@ -273,8 +273,8 @@ fn name(p: &mut Parser) {
name_r(p, TokenSet::empty())
}
fn name_ref(p: &mut Parser, allow_numeric_names: bool) {
if p.at(IDENT) || (allow_numeric_names && p.at(INT_NUMBER)) {
fn name_ref(p: &mut Parser) {
if p.at(IDENT) {
let m = p.start();
p.bump();
m.complete(p, NAME_REF);
@ -287,6 +287,16 @@ fn name_ref(p: &mut Parser, allow_numeric_names: bool) {
}
}
fn name_ref_or_index(p: &mut Parser) {
if p.at(IDENT) || p.at(INT_NUMBER) {
let m = p.start();
p.bump();
m.complete(p, NAME_REF);
} else {
p.err_and_bump("expected identifier");
}
}
fn error_block(p: &mut Parser, message: &str) {
assert!(p.at(T!['{']));
let m = p.start();