fix(frontends/lean/parser): allow '...' token to be used in imports
Before this commit, we could not write import ...foo.b We had to write import .. .foo.b or import . ..foo.b
This commit is contained in:
parent
2a5a904416
commit
cac10aa728
1 changed files with 16 additions and 6 deletions
|
@ -2165,12 +2165,22 @@ void parser::parse_imports() {
|
|||
next();
|
||||
while (true) {
|
||||
optional<unsigned> k;
|
||||
while (curr_is_token(get_period_tk())) {
|
||||
next();
|
||||
if (!k)
|
||||
k = 0;
|
||||
else
|
||||
k = *k + 1;
|
||||
while (true) {
|
||||
if (curr_is_token(get_period_tk())) {
|
||||
next();
|
||||
if (!k)
|
||||
k = 0;
|
||||
else
|
||||
k = *k + 1;
|
||||
} else if (curr_is_token(get_ellipsis_tk())) {
|
||||
next();
|
||||
if (!k)
|
||||
k = 2;
|
||||
else
|
||||
k = *k + 3;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!curr_is_identifier())
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue