feat(frontends/lean/scanner): allow ' in the beginning of identifiers
This commit is contained in:
parent
b7a4f305d4
commit
d59bf05f20
2 changed files with 10 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
9
tests/lean/run/tick_id.lean
Normal file
9
tests/lean/run/tick_id.lean
Normal 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
|
||||
Loading…
Add table
Reference in a new issue