feat(frontends/lean/scanner): disallow hierarchical names such as 'x.1'

This commit is contained in:
Leonardo de Moura 2014-11-09 12:55:13 -08:00
parent df5a17cdce
commit ce889ddf60
3 changed files with 7 additions and 1 deletions

View file

@ -354,7 +354,7 @@ auto scanner::read_key_cmd_id() -> token_kind {
} else if (cs[i] == '.') {
next_utf(cs);
num_utfs++;
if (!is_id_rest(cs, i+1))
if (!is_id_first(cs, i+1))
break;
} else {
break;

5
tests/lean/bad_id.lean Normal file
View file

@ -0,0 +1,5 @@
import data.num
definition x.y := 10
definition x.1 := 10

View file

@ -0,0 +1 @@
bad_id.lean:5:12: error: invalid binder, '(', '{', '[', '{{', '⦃' or identifier expected