feat(frontends/lean/scanner): allow ' in the beginning of identifiers

This commit is contained in:
Leonardo de Moura 2016-11-17 11:53:21 -08:00
parent b7a4f305d4
commit d59bf05f20
2 changed files with 10 additions and 1 deletions

View file

@ -435,7 +435,7 @@ void scanner::next_utf(buffer<char> & cs) {
}
static bool is_id_first(buffer<char> const & cs, unsigned i) {
if (std::isalpha(cs[i]) || cs[i] == '_')
if (std::isalpha(cs[i]) || cs[i] == '_' || cs[i] == '\'')
return true;
unsigned u = utf8_to_unicode(cs.begin() + i, cs.end());
return is_letter_like_unicode(u);

View file

@ -0,0 +1,9 @@
def id₁ {'a : Type} (x : 'a) : 'a := x
def id₂ {α : Type} (a : α) : α := a
def id₃ {β : Type} (b : β) : β := b
check λ (α β : Type) (f : α → β) (a : α), f a
check λ ('a 'b : Type) (f : 'a → 'b) (a : 'a), f a