fix: bug in reference implementation of String.get?

This commit is contained in:
Mario Carneiro 2023-05-12 18:07:11 -04:00 committed by Leonardo de Moura
parent ad4b822734
commit 7f84bf07ba

View file

@ -60,7 +60,7 @@ def get (s : @& String) (p : @& Pos) : Char :=
def utf8GetAux? : List Char → Pos → Pos → Option Char
| [], _, _ => none
| c::cs, i, p => if i = p then c else utf8GetAux cs (i + c) p
| c::cs, i, p => if i = p then c else utf8GetAux? cs (i + c) p
@[extern "lean_string_utf8_get_opt"]
def get? : (@& String) → (@& Pos) → Option Char