feat(runtime): add utf8_prev and utf8_set

Next goal: implement string.iterator in Lean
This commit is contained in:
Leonardo de Moura 2019-03-11 18:05:40 -07:00
parent 609b8e87e5
commit cf3bbd7e25
15 changed files with 11417 additions and 10405 deletions

View file

@ -81,11 +81,31 @@ private def utf8_get_aux : list char → usize → usize → char
def utf8_get : (@& string) → utf8_pos → char
| ⟨s⟩ p := utf8_get_aux s 0 p
private def utf8_set_aux (c' : char) : list char → usize → usize → list char
| [] i p := []
| (c::cs) i p :=
if i = p then (c'::cs) else c::(utf8_set_aux cs (i + csize c) p)
@[extern cpp "lean::string_utf8_set"]
def utf8_set : string → utf8_pos → char → string
| ⟨s⟩ i c := ⟨utf8_set_aux c s 0 i⟩
@[extern cpp "lean::string_utf8_next"]
def utf8_next (s : @& string) (p : utf8_pos) : utf8_pos :=
let c := utf8_get s p in
p + csize c
private def utf8_prev_aux : list char → usize → usize → usize
| [] i p := 0
| (c::cs) i p :=
let cz := csize c in
let i' := i + cz in
if i' = p then i else utf8_prev_aux cs i' p
@[extern cpp "lean::string_utf8_prev"]
def utf8_prev : (@& string) → utf8_pos → utf8_pos
| ⟨s⟩ p := if p = 0 then 0 else utf8_prev_aux s 0 p
@[extern cpp "lean::string_utf8_at_end"]
def utf8_at_end : (@& string) → utf8_pos → bool
| s p := p ≥ utf8_byte_size s
@ -99,9 +119,46 @@ private def utf8_extract_aux₁ : list char → usize → usize → usize → li
| s@(c::cs) i b e := if i = b then utf8_extract_aux₂ s i e else utf8_extract_aux₁ cs (i + csize c) b e
@[extern cpp "lean::string_utf8_extract"]
def utf8_extract : (@& string) → utf8_pos → utf8_pos → string
def extract : (@& string) → utf8_pos → utf8_pos → string
| ⟨s⟩ b e := if b ≥ e then ⟨[]⟩ else ⟨utf8_extract_aux₁ s 0 b e⟩
def bsize (s : string) : usize :=
utf8_byte_size s
def trim_left_aux (s : string) : nat → utf8_pos → utf8_pos
| 0 i := i
| (n+1) i :=
if i ≥ s.bsize then i
else let c := s.utf8_get i in
if !c.is_whitespace then i
else trim_left_aux n (i + csize c)
def trim_left (s : string) : string :=
let b := trim_left_aux s s.bsize.to_nat 0 in
if b = 0 then s
else s.extract b s.bsize
def trim_right_aux (s : string) : nat → utf8_pos → utf8_pos
| 0 i := i
| (n+1) i :=
if i = 0 then i
else
let i' := s.utf8_prev i in
let c := s.utf8_get i' in
if !c.is_whitespace then i
else trim_right_aux n i'
def trim_right (s : string) : string :=
let e := trim_right_aux s s.bsize.to_nat s.bsize in
if e = s.bsize then s
else s.extract 0 e
def trim (s : string) : string :=
let b := trim_left_aux s s.bsize.to_nat 0 in
let e := trim_right_aux s s.bsize.to_nat s.bsize in
if b = 0 && e = s.bsize then s
else s.extract b e
/- In the VM, the string iterator is implemented as a pointer to the string being iterated + index.
TODO: mark it opaque. -/
structure iterator :=
@ -267,30 +324,6 @@ def popn_back (s : string) (n : nat) : string :=
def backn (s : string) (n : nat) : string :=
(s.mk_iterator.to_end.prevn n).remaining_to_string
private def trim_left_aux : nat → iterator → iterator
| 0 it := it
| (n+1) it :=
if it.curr.is_whitespace then trim_left_aux n it.next
else it
def trim_left (s : string) : string :=
(trim_left_aux s.length s.mk_iterator).remaining_to_string
private def trim_right_aux : nat → iterator → iterator
| 0 it := it
| (n+1) it :=
let it' := it.prev in
if it'.curr.is_whitespace then trim_right_aux n it'
else it
def trim_right (s : string) : string :=
(trim_right_aux s.length s.mk_iterator.to_end).prev_to_string
def trim (s : string) : string :=
let l := trim_left_aux s.length s.mk_iterator in
let r := trim_right_aux s.length s.mk_iterator.to_end in
(l.extract r).get_or_else ""
private def line_column_aux : nat → string.iterator → nat × nat → nat × nat
| 0 it r := r
| (k+1) it r@(line, col) :=

View file

@ -23,11 +23,17 @@ obj* string_iterator_prev_to_string(obj*);
}
usize l___private_init_data_string_basic_2__utf8__byte__size__aux___main(obj*, usize);
uint32 l_string_front(obj*);
obj* l___private_init_data_string_basic_6__utf8__extract__aux_u_2082___main(obj*, usize, usize);
usize l_string_trim__left__aux___main(obj*, obj*, usize);
obj* l_string_trim__left___boxed(obj*);
uint8 l_char_is__whitespace(uint32);
obj* l___private_init_data_string_basic_5__utf8__extract__aux_u_2081___main(obj*, usize, usize, usize);
obj* l___private_init_data_string_basic_6__utf8__extract__aux_u_2082___main___boxed(obj*, obj*, obj*);
obj* l_string_iterator_prev__to__string___boxed(obj*);
obj* l___private_init_data_string_basic_7__trim__right__aux___main(obj*, obj*);
namespace lean {
obj* string_utf8_extract(obj*, usize, usize);
}
obj* l_string_pushn___boxed(obj*, obj*, obj*);
usize l_string_trim__right__aux(obj*, obj*, usize);
namespace lean {
obj* nat_add(obj*, obj*);
}
@ -36,30 +42,34 @@ obj* l___private_init_data_string_basic_9__to__nat__core___main(obj*, obj*, obj*
obj* l_string_iterator_remaining___boxed(obj*);
obj* l_string_iterator_forward(obj*, obj*);
obj* l_string_decidable__eq;
obj* l___private_init_data_string_basic_7__utf8__extract__aux_u_2081___main___boxed(obj*, obj*, obj*, obj*);
obj* l_string_line__column___closed__1;
obj* l_list_foldl___main___at_string_join___spec__1___boxed(obj*, obj*);
obj* l_string_singleton(uint32);
obj* l_string_pushn(obj*, uint32, obj*);
obj* l_list_as__string(obj*);
obj* l___private_init_data_string_basic_4__utf8__set__aux___main___boxed(obj*, obj*, obj*, obj*);
obj* l_string_iterator_forward___main(obj*, obj*);
obj* l_string_iterator_has__next___boxed(obj*);
obj* l_string_trim__right__aux___boxed(obj*, obj*, obj*);
obj* l_nat_repeat__core___main___at_string_pushn___spec__1(uint32, obj*, obj*, obj*);
obj* l_string_iterator_extract__core(obj*, obj*);
obj* l_string_back___boxed(obj*);
obj* l___private_init_data_string_basic_4__utf8__extract__aux_u_2082(obj*, usize, usize);
namespace lean {
obj* string_utf8_extract(obj*, usize, usize);
}
obj* l_string_trim___boxed(obj*);
namespace lean {
obj* string_iterator_next(obj*);
}
namespace lean {
usize string_utf8_next(obj*, usize);
}
obj* l___private_init_data_string_basic_5__utf8__prev__aux___main___boxed(obj*, obj*, obj*);
obj* l_string_trim__right___boxed(obj*);
usize l___private_init_data_string_basic_5__utf8__prev__aux(obj*, usize, usize);
namespace lean {
usize string_utf8_byte_size(obj*);
}
obj* l_string_singleton___boxed(obj*);
obj* l_string_bsize___boxed(obj*);
usize l___private_init_data_string_basic_1__csize(uint32);
namespace lean {
obj* string_length(obj*);
@ -79,12 +89,16 @@ obj* string_append(obj*, obj*);
}
obj* l_string_iterator_insert___boxed(obj*, obj*);
obj* l_string_pop__back(obj*);
usize l_string_trim__left__aux(obj*, obj*, usize);
uint32 l___private_init_data_string_basic_3__utf8__get__aux___main(obj*, usize, usize);
obj* l_string_intercalate(obj*, obj*);
obj* l___private_init_data_string_basic_3__utf8__get__aux___main___boxed(obj*, obj*, obj*);
namespace lean {
uint8 string_dec_lt(obj*, obj*);
}
namespace lean {
usize string_utf8_prev(obj*, usize);
}
obj* l_char_to__string___boxed(obj*);
namespace lean {
obj* string_iterator_to_end(obj*);
@ -95,8 +109,6 @@ obj* string_iterator_extract(obj*, obj*);
}
uint32 l_string_back(obj*);
obj* l_string_utf8__begin___boxed;
obj* l_option_get__or__else___main___rarg(obj*, obj*);
obj* l___private_init_data_string_basic_4__utf8__extract__aux_u_2082___main___boxed(obj*, obj*, obj*);
namespace lean {
obj* string_data(obj*);
}
@ -109,6 +121,7 @@ uint8 string_iterator_has_next(obj*);
obj* l___private_init_data_string_basic_8__line__column__aux(obj*, obj*, obj*);
obj* l_string_utf8__at__end___boxed(obj*, obj*);
obj* l___private_init_data_string_basic_9__to__nat__core___main___closed__1;
obj* l___private_init_data_string_basic_7__utf8__extract__aux_u_2081(obj*, usize, usize, usize);
namespace lean {
uint8 nat_dec_eq(obj*, obj*);
}
@ -116,7 +129,10 @@ namespace lean {
obj* string_iterator_remaining_to_string(obj*);
}
obj* l_string_line__column(obj*, obj*);
obj* l___private_init_data_string_basic_4__utf8__set__aux___boxed(obj*, obj*, obj*, obj*);
obj* l_string_iterator_nextn___main(obj*, obj*);
obj* l_string_trim__right__aux___main___boxed(obj*, obj*, obj*);
obj* l___private_init_data_string_basic_4__utf8__set__aux(uint32, obj*, usize, usize);
obj* l_string_length___boxed(obj*);
obj* l_string_iterator_to__string___boxed(obj*);
obj* l_string_iterator_remove___boxed(obj*, obj*);
@ -129,8 +145,8 @@ obj* l___private_init_data_string_basic_8__line__column__aux___main(obj*, obj*,
namespace lean {
obj* uint32_to_nat(uint32);
}
obj* l___private_init_data_string_basic_6__trim__left__aux(obj*, obj*);
obj* l_string_utf8__get___boxed(obj*, obj*);
obj* l_string_trim__left__aux___main___boxed(obj*, obj*, obj*);
obj* l_string_has__append;
namespace lean {
obj* string_iterator_prev(obj*);
@ -144,13 +160,12 @@ obj* l_list_intercalate___rarg(obj*, obj*);
namespace lean {
obj* string_iterator_offset(obj*);
}
obj* l___private_init_data_string_basic_5__utf8__extract__aux_u_2081___boxed(obj*, obj*, obj*, obj*);
obj* l_string_utf8__byte__size___boxed(obj*);
namespace lean {
obj* string_mk(obj*);
}
usize l___private_init_data_string_basic_5__utf8__prev__aux___main(obj*, usize, usize);
obj* l_string_inhabited;
obj* l___private_init_data_string_basic_5__utf8__extract__aux_u_2081___main___boxed(obj*, obj*, obj*, obj*);
obj* l_string_join(obj*);
obj* l___private_init_data_string_basic_2__utf8__byte__size__aux___boxed(obj*, obj*);
uint8 l_string_iterator_decidable__rel(obj*, obj*);
@ -158,6 +173,7 @@ obj* l_string_push___boxed(obj*, obj*);
obj* l_string_dec__eq___boxed(obj*, obj*);
obj* l_string_mk__iterator___boxed(obj*);
obj* l_string_iterator_decidable__rel___boxed(obj*, obj*);
obj* l_string_utf8__prev___boxed(obj*, obj*);
obj* l_string_utf8__next___boxed(obj*, obj*);
obj* l_list_has__dec__eq___main___at_string_iterator_extract__core___main___spec__1___boxed(obj*, obj*);
obj* l_string_iterator_nextn(obj*, obj*);
@ -171,8 +187,10 @@ uint32 l_char_utf8__size(uint32);
namespace lean {
obj* string_iterator_insert(obj*, obj*);
}
obj* l___private_init_data_string_basic_6__trim__left__aux___main(obj*, obj*);
obj* l___private_init_data_string_basic_3__utf8__get__aux___boxed(obj*, obj*, obj*);
namespace lean {
obj* string_utf8_set(obj*, usize, uint32);
}
obj* l_char_to__string(uint32);
namespace lean {
obj* string_iterator_remaining(obj*);
@ -183,15 +201,17 @@ usize usize_of_nat(obj*);
namespace lean {
obj* string_mk_iterator(obj*);
}
usize l_string_bsize(obj*);
obj* l_list_map___main___at_string_intercalate___spec__1(obj*);
obj* l_string_utf8__extract___boxed(obj*, obj*, obj*);
obj* l_string_has__sizeof;
obj* l_string_to__list(obj*);
obj* l_string_trim(obj*);
obj* l_string_utf8__set___boxed(obj*, obj*, obj*);
uint8 l_list_has__dec__eq___main___at_string_iterator_extract__core___main___spec__1(obj*, obj*);
obj* l___private_init_data_string_basic_4__utf8__extract__aux_u_2082___main(obj*, usize, usize);
obj* l___private_init_data_string_basic_6__utf8__extract__aux_u_2082___boxed(obj*, obj*, obj*);
obj* l_string_iterator_set__curr___boxed(obj*, obj*);
obj* l_nat_repeat__core___main___at_string_pushn___spec__1___boxed(obj*, obj*, obj*, obj*);
obj* l_string_extract___boxed(obj*, obj*, obj*);
obj* l_string_iterator_prev___boxed(obj*);
namespace lean {
uint32 uint32_of_nat(obj*);
@ -200,6 +220,8 @@ namespace lean {
obj* nat_mul(obj*, obj*);
}
obj* l_string_is__empty___boxed(obj*);
obj* l___private_init_data_string_basic_4__utf8__set__aux___main(uint32, obj*, usize, usize);
obj* l___private_init_data_string_basic_6__utf8__extract__aux_u_2082(obj*, usize, usize);
namespace lean {
uint8 string_iterator_has_prev(obj*);
}
@ -220,14 +242,19 @@ namespace lean {
uint8 string_utf8_at_end(obj*, usize);
}
obj* l_string_iterator_remaining__to__string___boxed(obj*);
obj* l___private_init_data_string_basic_5__utf8__extract__aux_u_2081(obj*, usize, usize, usize);
usize l_string_trim__right__aux___main(obj*, obj*, usize);
namespace lean {
obj* string_iterator_to_string(obj*);
}
obj* l___private_init_data_string_basic_7__trim__right__aux(obj*, obj*);
obj* l_string_iterator_has__prev___boxed(obj*);
obj* l___private_init_data_string_basic_7__utf8__extract__aux_u_2081___main(obj*, usize, usize, usize);
namespace lean {
obj* usize_to_nat(usize);
}
obj* l___private_init_data_string_basic_7__utf8__extract__aux_u_2081___boxed(obj*, obj*, obj*, obj*);
obj* l___private_init_data_string_basic_5__utf8__prev__aux___boxed(obj*, obj*, obj*);
obj* l_string_dec__lt___boxed(obj*, obj*);
obj* l___private_init_data_string_basic_4__utf8__extract__aux_u_2082___boxed(obj*, obj*, obj*);
obj* l_string_trim__left__aux___boxed(obj*, obj*, obj*);
obj* l_string_join___boxed(obj*);
obj* l_string_dec__eq___boxed(obj* x_0, obj* x_1) {
_start:
@ -484,6 +511,102 @@ lean::dec(x_0);
return x_4;
}
}
obj* l___private_init_data_string_basic_4__utf8__set__aux___main(uint32 x_0, obj* x_1, usize x_2, usize x_3) {
_start:
{
if (lean::obj_tag(x_1) == 0)
{
return x_1;
}
else
{
obj* x_4; obj* x_6; obj* x_8; uint8 x_9;
x_4 = lean::cnstr_get(x_1, 0);
x_6 = lean::cnstr_get(x_1, 1);
if (lean::is_exclusive(x_1)) {
lean::cnstr_set(x_1, 0, lean::box(0));
lean::cnstr_set(x_1, 1, lean::box(0));
x_8 = x_1;
} else {
lean::inc(x_4);
lean::inc(x_6);
lean::dec(x_1);
x_8 = lean::box(0);
}
x_9 = x_2 == x_3;
if (x_9 == 0)
{
uint32 x_10; usize x_11; usize x_12; obj* x_13; obj* x_14;
x_10 = lean::unbox_uint32(x_4);
x_11 = l___private_init_data_string_basic_1__csize(x_10);
x_12 = x_2 + x_11;
x_13 = l___private_init_data_string_basic_4__utf8__set__aux___main(x_0, x_6, x_12, x_3);
if (lean::is_scalar(x_8)) {
x_14 = lean::alloc_cnstr(1, 2, 0);
} else {
x_14 = x_8;
}
lean::cnstr_set(x_14, 0, x_4);
lean::cnstr_set(x_14, 1, x_13);
return x_14;
}
else
{
obj* x_16; obj* x_17;
lean::dec(x_4);
x_16 = lean::box_uint32(x_0);
if (lean::is_scalar(x_8)) {
x_17 = lean::alloc_cnstr(1, 2, 0);
} else {
x_17 = x_8;
}
lean::cnstr_set(x_17, 0, x_16);
lean::cnstr_set(x_17, 1, x_6);
return x_17;
}
}
}
}
obj* l___private_init_data_string_basic_4__utf8__set__aux___main___boxed(obj* x_0, obj* x_1, obj* x_2, obj* x_3) {
_start:
{
uint32 x_4; usize x_5; usize x_6; obj* x_7;
x_4 = lean::unbox_uint32(x_0);
x_5 = lean::unbox_size_t(x_2);
x_6 = lean::unbox_size_t(x_3);
x_7 = l___private_init_data_string_basic_4__utf8__set__aux___main(x_4, x_1, x_5, x_6);
return x_7;
}
}
obj* l___private_init_data_string_basic_4__utf8__set__aux(uint32 x_0, obj* x_1, usize x_2, usize x_3) {
_start:
{
obj* x_4;
x_4 = l___private_init_data_string_basic_4__utf8__set__aux___main(x_0, x_1, x_2, x_3);
return x_4;
}
}
obj* l___private_init_data_string_basic_4__utf8__set__aux___boxed(obj* x_0, obj* x_1, obj* x_2, obj* x_3) {
_start:
{
uint32 x_4; usize x_5; usize x_6; obj* x_7;
x_4 = lean::unbox_uint32(x_0);
x_5 = lean::unbox_size_t(x_2);
x_6 = lean::unbox_size_t(x_3);
x_7 = l___private_init_data_string_basic_4__utf8__set__aux(x_4, x_1, x_5, x_6);
return x_7;
}
}
obj* l_string_utf8__set___boxed(obj* x_0, obj* x_1, obj* x_2) {
_start:
{
usize x_3; uint32 x_4; obj* x_5;
x_3 = lean::unbox_size_t(x_1);
x_4 = lean::unbox_uint32(x_2);
x_5 = lean::string_utf8_set(x_0, x_3, x_4);
return x_5;
}
}
obj* l_string_utf8__next___boxed(obj* x_0, obj* x_1) {
_start:
{
@ -495,6 +618,80 @@ lean::dec(x_0);
return x_4;
}
}
usize l___private_init_data_string_basic_5__utf8__prev__aux___main(obj* x_0, usize x_1, usize x_2) {
_start:
{
if (lean::obj_tag(x_0) == 0)
{
usize x_3;
x_3 = 0;
return x_3;
}
else
{
obj* x_4; obj* x_5; uint32 x_6; usize x_7; usize x_8; uint8 x_9;
x_4 = lean::cnstr_get(x_0, 0);
x_5 = lean::cnstr_get(x_0, 1);
x_6 = lean::unbox_uint32(x_4);
x_7 = l___private_init_data_string_basic_1__csize(x_6);
x_8 = x_1 + x_7;
x_9 = x_8 == x_2;
if (x_9 == 0)
{
x_0 = x_5;
x_1 = x_8;
goto _start;
}
else
{
return x_1;
}
}
}
}
obj* l___private_init_data_string_basic_5__utf8__prev__aux___main___boxed(obj* x_0, obj* x_1, obj* x_2) {
_start:
{
usize x_3; usize x_4; usize x_5; obj* x_6;
x_3 = lean::unbox_size_t(x_1);
x_4 = lean::unbox_size_t(x_2);
x_5 = l___private_init_data_string_basic_5__utf8__prev__aux___main(x_0, x_3, x_4);
x_6 = lean::box_size_t(x_5);
lean::dec(x_0);
return x_6;
}
}
usize l___private_init_data_string_basic_5__utf8__prev__aux(obj* x_0, usize x_1, usize x_2) {
_start:
{
usize x_3;
x_3 = l___private_init_data_string_basic_5__utf8__prev__aux___main(x_0, x_1, x_2);
return x_3;
}
}
obj* l___private_init_data_string_basic_5__utf8__prev__aux___boxed(obj* x_0, obj* x_1, obj* x_2) {
_start:
{
usize x_3; usize x_4; usize x_5; obj* x_6;
x_3 = lean::unbox_size_t(x_1);
x_4 = lean::unbox_size_t(x_2);
x_5 = l___private_init_data_string_basic_5__utf8__prev__aux(x_0, x_3, x_4);
x_6 = lean::box_size_t(x_5);
lean::dec(x_0);
return x_6;
}
}
obj* l_string_utf8__prev___boxed(obj* x_0, obj* x_1) {
_start:
{
usize x_2; usize x_3; obj* x_4;
x_2 = lean::unbox_size_t(x_1);
x_3 = lean::string_utf8_prev(x_0, x_2);
x_4 = lean::box_size_t(x_3);
lean::dec(x_0);
return x_4;
}
}
obj* l_string_utf8__at__end___boxed(obj* x_0, obj* x_1) {
_start:
{
@ -506,7 +703,7 @@ lean::dec(x_0);
return x_4;
}
}
obj* l___private_init_data_string_basic_4__utf8__extract__aux_u_2082___main(obj* x_0, usize x_1, usize x_2) {
obj* l___private_init_data_string_basic_6__utf8__extract__aux_u_2082___main(obj* x_0, usize x_1, usize x_2) {
_start:
{
if (lean::obj_tag(x_0) == 0)
@ -535,7 +732,7 @@ uint32 x_9; usize x_10; usize x_11; obj* x_12; obj* x_13;
x_9 = lean::unbox_uint32(x_3);
x_10 = l___private_init_data_string_basic_1__csize(x_9);
x_11 = x_1 + x_10;
x_12 = l___private_init_data_string_basic_4__utf8__extract__aux_u_2082___main(x_5, x_11, x_2);
x_12 = l___private_init_data_string_basic_6__utf8__extract__aux_u_2082___main(x_5, x_11, x_2);
if (lean::is_scalar(x_7)) {
x_13 = lean::alloc_cnstr(1, 2, 0);
} else {
@ -557,35 +754,35 @@ return x_17;
}
}
}
obj* l___private_init_data_string_basic_4__utf8__extract__aux_u_2082___main___boxed(obj* x_0, obj* x_1, obj* x_2) {
obj* l___private_init_data_string_basic_6__utf8__extract__aux_u_2082___main___boxed(obj* x_0, obj* x_1, obj* x_2) {
_start:
{
usize x_3; usize x_4; obj* x_5;
x_3 = lean::unbox_size_t(x_1);
x_4 = lean::unbox_size_t(x_2);
x_5 = l___private_init_data_string_basic_4__utf8__extract__aux_u_2082___main(x_0, x_3, x_4);
x_5 = l___private_init_data_string_basic_6__utf8__extract__aux_u_2082___main(x_0, x_3, x_4);
return x_5;
}
}
obj* l___private_init_data_string_basic_4__utf8__extract__aux_u_2082(obj* x_0, usize x_1, usize x_2) {
obj* l___private_init_data_string_basic_6__utf8__extract__aux_u_2082(obj* x_0, usize x_1, usize x_2) {
_start:
{
obj* x_3;
x_3 = l___private_init_data_string_basic_4__utf8__extract__aux_u_2082___main(x_0, x_1, x_2);
x_3 = l___private_init_data_string_basic_6__utf8__extract__aux_u_2082___main(x_0, x_1, x_2);
return x_3;
}
}
obj* l___private_init_data_string_basic_4__utf8__extract__aux_u_2082___boxed(obj* x_0, obj* x_1, obj* x_2) {
obj* l___private_init_data_string_basic_6__utf8__extract__aux_u_2082___boxed(obj* x_0, obj* x_1, obj* x_2) {
_start:
{
usize x_3; usize x_4; obj* x_5;
x_3 = lean::unbox_size_t(x_1);
x_4 = lean::unbox_size_t(x_2);
x_5 = l___private_init_data_string_basic_4__utf8__extract__aux_u_2082(x_0, x_3, x_4);
x_5 = l___private_init_data_string_basic_6__utf8__extract__aux_u_2082(x_0, x_3, x_4);
return x_5;
}
}
obj* l___private_init_data_string_basic_5__utf8__extract__aux_u_2081___main(obj* x_0, usize x_1, usize x_2, usize x_3) {
obj* l___private_init_data_string_basic_7__utf8__extract__aux_u_2081___main(obj* x_0, usize x_1, usize x_2, usize x_3) {
_start:
{
if (lean::obj_tag(x_0) == 0)
@ -616,43 +813,43 @@ else
obj* x_16;
lean::dec(x_6);
lean::dec(x_4);
x_16 = l___private_init_data_string_basic_4__utf8__extract__aux_u_2082___main(x_0, x_1, x_3);
x_16 = l___private_init_data_string_basic_6__utf8__extract__aux_u_2082___main(x_0, x_1, x_3);
return x_16;
}
}
}
}
obj* l___private_init_data_string_basic_5__utf8__extract__aux_u_2081___main___boxed(obj* x_0, obj* x_1, obj* x_2, obj* x_3) {
obj* l___private_init_data_string_basic_7__utf8__extract__aux_u_2081___main___boxed(obj* x_0, obj* x_1, obj* x_2, obj* x_3) {
_start:
{
usize x_4; usize x_5; usize x_6; obj* x_7;
x_4 = lean::unbox_size_t(x_1);
x_5 = lean::unbox_size_t(x_2);
x_6 = lean::unbox_size_t(x_3);
x_7 = l___private_init_data_string_basic_5__utf8__extract__aux_u_2081___main(x_0, x_4, x_5, x_6);
x_7 = l___private_init_data_string_basic_7__utf8__extract__aux_u_2081___main(x_0, x_4, x_5, x_6);
return x_7;
}
}
obj* l___private_init_data_string_basic_5__utf8__extract__aux_u_2081(obj* x_0, usize x_1, usize x_2, usize x_3) {
obj* l___private_init_data_string_basic_7__utf8__extract__aux_u_2081(obj* x_0, usize x_1, usize x_2, usize x_3) {
_start:
{
obj* x_4;
x_4 = l___private_init_data_string_basic_5__utf8__extract__aux_u_2081___main(x_0, x_1, x_2, x_3);
x_4 = l___private_init_data_string_basic_7__utf8__extract__aux_u_2081___main(x_0, x_1, x_2, x_3);
return x_4;
}
}
obj* l___private_init_data_string_basic_5__utf8__extract__aux_u_2081___boxed(obj* x_0, obj* x_1, obj* x_2, obj* x_3) {
obj* l___private_init_data_string_basic_7__utf8__extract__aux_u_2081___boxed(obj* x_0, obj* x_1, obj* x_2, obj* x_3) {
_start:
{
usize x_4; usize x_5; usize x_6; obj* x_7;
x_4 = lean::unbox_size_t(x_1);
x_5 = lean::unbox_size_t(x_2);
x_6 = lean::unbox_size_t(x_3);
x_7 = l___private_init_data_string_basic_5__utf8__extract__aux_u_2081(x_0, x_4, x_5, x_6);
x_7 = l___private_init_data_string_basic_7__utf8__extract__aux_u_2081(x_0, x_4, x_5, x_6);
return x_7;
}
}
obj* l_string_utf8__extract___boxed(obj* x_0, obj* x_1, obj* x_2) {
obj* l_string_extract___boxed(obj* x_0, obj* x_1, obj* x_2) {
_start:
{
usize x_3; usize x_4; obj* x_5;
@ -663,6 +860,283 @@ lean::dec(x_0);
return x_5;
}
}
usize l_string_bsize(obj* x_0) {
_start:
{
usize x_1;
x_1 = lean::string_utf8_byte_size(x_0);
return x_1;
}
}
obj* l_string_bsize___boxed(obj* x_0) {
_start:
{
usize x_1; obj* x_2;
x_1 = l_string_bsize(x_0);
x_2 = lean::box_size_t(x_1);
lean::dec(x_0);
return x_2;
}
}
usize l_string_trim__left__aux___main(obj* x_0, obj* x_1, usize x_2) {
_start:
{
obj* x_3; uint8 x_4;
x_3 = lean::mk_nat_obj(0u);
x_4 = lean::nat_dec_eq(x_1, x_3);
if (x_4 == 0)
{
usize x_5; uint8 x_6;
x_5 = lean::string_utf8_byte_size(x_0);
x_6 = x_5 <= x_2;
if (x_6 == 0)
{
uint32 x_7; uint8 x_8;
x_7 = lean::string_utf8_get(x_0, x_2);
x_8 = l_char_is__whitespace(x_7);
if (x_8 == 0)
{
lean::dec(x_1);
return x_2;
}
else
{
obj* x_10; obj* x_11; usize x_13; usize x_14;
x_10 = lean::mk_nat_obj(1u);
x_11 = lean::nat_sub(x_1, x_10);
lean::dec(x_1);
x_13 = l___private_init_data_string_basic_1__csize(x_7);
x_14 = x_2 + x_13;
x_1 = x_11;
x_2 = x_14;
goto _start;
}
}
else
{
lean::dec(x_1);
return x_2;
}
}
else
{
lean::dec(x_1);
return x_2;
}
}
}
obj* l_string_trim__left__aux___main___boxed(obj* x_0, obj* x_1, obj* x_2) {
_start:
{
usize x_3; usize x_4; obj* x_5;
x_3 = lean::unbox_size_t(x_2);
x_4 = l_string_trim__left__aux___main(x_0, x_1, x_3);
x_5 = lean::box_size_t(x_4);
lean::dec(x_0);
return x_5;
}
}
usize l_string_trim__left__aux(obj* x_0, obj* x_1, usize x_2) {
_start:
{
usize x_3;
x_3 = l_string_trim__left__aux___main(x_0, x_1, x_2);
return x_3;
}
}
obj* l_string_trim__left__aux___boxed(obj* x_0, obj* x_1, obj* x_2) {
_start:
{
usize x_3; usize x_4; obj* x_5;
x_3 = lean::unbox_size_t(x_2);
x_4 = l_string_trim__left__aux(x_0, x_1, x_3);
x_5 = lean::box_size_t(x_4);
lean::dec(x_0);
return x_5;
}
}
obj* l_string_trim__left(obj* x_0) {
_start:
{
usize x_1; obj* x_2; usize x_3; usize x_4; uint8 x_5;
x_1 = lean::string_utf8_byte_size(x_0);
x_2 = lean::usize_to_nat(x_1);
x_3 = 0;
x_4 = l_string_trim__left__aux___main(x_0, x_2, x_3);
x_5 = x_4 == x_3;
if (x_5 == 0)
{
obj* x_6;
x_6 = lean::string_utf8_extract(x_0, x_4, x_1);
return x_6;
}
else
{
lean::inc(x_0);
return x_0;
}
}
}
obj* l_string_trim__left___boxed(obj* x_0) {
_start:
{
obj* x_1;
x_1 = l_string_trim__left(x_0);
lean::dec(x_0);
return x_1;
}
}
usize l_string_trim__right__aux___main(obj* x_0, obj* x_1, usize x_2) {
_start:
{
obj* x_3; uint8 x_4;
x_3 = lean::mk_nat_obj(0u);
x_4 = lean::nat_dec_eq(x_1, x_3);
if (x_4 == 0)
{
usize x_5; uint8 x_6;
x_5 = 0;
x_6 = x_2 == x_5;
if (x_6 == 0)
{
usize x_7; uint32 x_8; uint8 x_9;
x_7 = lean::string_utf8_prev(x_0, x_2);
x_8 = lean::string_utf8_get(x_0, x_7);
x_9 = l_char_is__whitespace(x_8);
if (x_9 == 0)
{
lean::dec(x_1);
return x_2;
}
else
{
obj* x_11; obj* x_12;
x_11 = lean::mk_nat_obj(1u);
x_12 = lean::nat_sub(x_1, x_11);
lean::dec(x_1);
x_1 = x_12;
x_2 = x_7;
goto _start;
}
}
else
{
lean::dec(x_1);
return x_2;
}
}
else
{
lean::dec(x_1);
return x_2;
}
}
}
obj* l_string_trim__right__aux___main___boxed(obj* x_0, obj* x_1, obj* x_2) {
_start:
{
usize x_3; usize x_4; obj* x_5;
x_3 = lean::unbox_size_t(x_2);
x_4 = l_string_trim__right__aux___main(x_0, x_1, x_3);
x_5 = lean::box_size_t(x_4);
lean::dec(x_0);
return x_5;
}
}
usize l_string_trim__right__aux(obj* x_0, obj* x_1, usize x_2) {
_start:
{
usize x_3;
x_3 = l_string_trim__right__aux___main(x_0, x_1, x_2);
return x_3;
}
}
obj* l_string_trim__right__aux___boxed(obj* x_0, obj* x_1, obj* x_2) {
_start:
{
usize x_3; usize x_4; obj* x_5;
x_3 = lean::unbox_size_t(x_2);
x_4 = l_string_trim__right__aux(x_0, x_1, x_3);
x_5 = lean::box_size_t(x_4);
lean::dec(x_0);
return x_5;
}
}
obj* l_string_trim__right(obj* x_0) {
_start:
{
usize x_1; obj* x_2; usize x_3; uint8 x_4;
x_1 = lean::string_utf8_byte_size(x_0);
x_2 = lean::usize_to_nat(x_1);
x_3 = l_string_trim__right__aux___main(x_0, x_2, x_1);
x_4 = x_3 == x_1;
if (x_4 == 0)
{
usize x_5; obj* x_6;
x_5 = 0;
x_6 = lean::string_utf8_extract(x_0, x_5, x_3);
return x_6;
}
else
{
lean::inc(x_0);
return x_0;
}
}
}
obj* l_string_trim__right___boxed(obj* x_0) {
_start:
{
obj* x_1;
x_1 = l_string_trim__right(x_0);
lean::dec(x_0);
return x_1;
}
}
obj* l_string_trim(obj* x_0) {
_start:
{
usize x_1; obj* x_2; usize x_3; usize x_5; usize x_6; uint8 x_7;
x_1 = lean::string_utf8_byte_size(x_0);
x_2 = lean::usize_to_nat(x_1);
x_3 = 0;
lean::inc(x_2);
x_5 = l_string_trim__left__aux___main(x_0, x_2, x_3);
x_6 = l_string_trim__right__aux___main(x_0, x_2, x_1);
x_7 = x_5 == x_3;
if (x_7 == 0)
{
obj* x_8;
x_8 = lean::string_utf8_extract(x_0, x_5, x_6);
return x_8;
}
else
{
uint8 x_9;
x_9 = x_6 == x_1;
if (x_9 == 0)
{
obj* x_10;
x_10 = lean::string_utf8_extract(x_0, x_5, x_6);
return x_10;
}
else
{
lean::inc(x_0);
return x_0;
}
}
}
}
obj* l_string_trim___boxed(obj* x_0) {
_start:
{
obj* x_1;
x_1 = l_string_trim(x_0);
lean::dec(x_0);
return x_1;
}
}
obj* l_string_mk__iterator___boxed(obj* x_0) {
_start:
{
@ -1449,140 +1923,6 @@ lean::dec(x_4);
return x_5;
}
}
obj* l___private_init_data_string_basic_6__trim__left__aux___main(obj* x_0, obj* x_1) {
_start:
{
obj* x_2; uint8 x_3;
x_2 = lean::mk_nat_obj(0u);
x_3 = lean::nat_dec_eq(x_0, x_2);
if (x_3 == 0)
{
uint32 x_4; uint8 x_5;
x_4 = lean::string_iterator_curr(x_1);
x_5 = l_char_is__whitespace(x_4);
if (x_5 == 0)
{
lean::dec(x_0);
return x_1;
}
else
{
obj* x_7; obj* x_8; obj* x_10;
x_7 = lean::mk_nat_obj(1u);
x_8 = lean::nat_sub(x_0, x_7);
lean::dec(x_0);
x_10 = lean::string_iterator_next(x_1);
x_0 = x_8;
x_1 = x_10;
goto _start;
}
}
else
{
lean::dec(x_0);
return x_1;
}
}
}
obj* l___private_init_data_string_basic_6__trim__left__aux(obj* x_0, obj* x_1) {
_start:
{
obj* x_2;
x_2 = l___private_init_data_string_basic_6__trim__left__aux___main(x_0, x_1);
return x_2;
}
}
obj* l_string_trim__left(obj* x_0) {
_start:
{
obj* x_1; obj* x_2; obj* x_3; obj* x_4;
x_1 = lean::string_length(x_0);
x_2 = lean::string_mk_iterator(x_0);
x_3 = l___private_init_data_string_basic_6__trim__left__aux___main(x_1, x_2);
x_4 = lean::string_iterator_remaining_to_string(x_3);
lean::dec(x_3);
return x_4;
}
}
obj* l___private_init_data_string_basic_7__trim__right__aux___main(obj* x_0, obj* x_1) {
_start:
{
obj* x_2; uint8 x_3;
x_2 = lean::mk_nat_obj(0u);
x_3 = lean::nat_dec_eq(x_0, x_2);
if (x_3 == 0)
{
obj* x_5; uint32 x_6; uint8 x_7;
lean::inc(x_1);
x_5 = lean::string_iterator_prev(x_1);
x_6 = lean::string_iterator_curr(x_5);
x_7 = l_char_is__whitespace(x_6);
if (x_7 == 0)
{
lean::dec(x_5);
lean::dec(x_0);
return x_1;
}
else
{
obj* x_11; obj* x_12;
lean::dec(x_1);
x_11 = lean::mk_nat_obj(1u);
x_12 = lean::nat_sub(x_0, x_11);
lean::dec(x_0);
x_0 = x_12;
x_1 = x_5;
goto _start;
}
}
else
{
lean::dec(x_0);
return x_1;
}
}
}
obj* l___private_init_data_string_basic_7__trim__right__aux(obj* x_0, obj* x_1) {
_start:
{
obj* x_2;
x_2 = l___private_init_data_string_basic_7__trim__right__aux___main(x_0, x_1);
return x_2;
}
}
obj* l_string_trim__right(obj* x_0) {
_start:
{
obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_5;
x_1 = lean::string_length(x_0);
x_2 = lean::string_mk_iterator(x_0);
x_3 = lean::string_iterator_to_end(x_2);
x_4 = l___private_init_data_string_basic_7__trim__right__aux___main(x_1, x_3);
x_5 = lean::string_iterator_prev_to_string(x_4);
lean::dec(x_4);
return x_5;
}
}
obj* l_string_trim(obj* x_0) {
_start:
{
obj* x_1; obj* x_2; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_11; obj* x_12;
x_1 = lean::string_length(x_0);
x_2 = lean::string_mk_iterator(x_0);
lean::inc(x_2);
lean::inc(x_1);
x_5 = l___private_init_data_string_basic_6__trim__left__aux___main(x_1, x_2);
x_6 = lean::string_iterator_to_end(x_2);
x_7 = l___private_init_data_string_basic_7__trim__right__aux___main(x_1, x_6);
x_8 = lean::string_iterator_extract(x_5, x_7);
lean::dec(x_7);
lean::dec(x_5);
x_11 = l_string_join___closed__1;
x_12 = l_option_get__or__else___main___rarg(x_8, x_11);
lean::dec(x_8);
return x_12;
}
}
obj* l___private_init_data_string_basic_8__line__column__aux___main(obj* x_0, obj* x_1, obj* x_2) {
_start:
{

File diff suppressed because it is too large Load diff

View file

@ -841,31 +841,33 @@ return x_1;
obj* _init_l_lean_expander_coe__binder__bracketed__binder___closed__1() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string("(");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* _init_l_lean_expander_coe__binder__bracketed__binder___closed__2() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string(")");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* l_lean_expander_coe__binder__bracketed__binder(obj* x_0) {
@ -1169,16 +1171,17 @@ return x_3;
obj* _init_l_list_mmap_x_27___main___at_lean_expander_mk__notation__transformer___spec__4___closed__3() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string(",");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* l_list_mmap_x_27___main___at_lean_expander_mk__notation__transformer___spec__4(obj* x_0, obj* x_1, obj* x_2, obj* x_3) {
@ -3069,16 +3072,17 @@ return x_13;
obj* _init_l_lean_expander_mixfix__to__notation__spec___closed__4() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string(":");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* _init_l_lean_expander_mixfix__to__notation__spec___closed__5() {
@ -3529,31 +3533,33 @@ return x_16;
obj* _init_l_lean_expander_mixfix_transform___closed__3() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string("notation");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* _init_l_lean_expander_mixfix_transform___closed__4() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string(":=");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* _init_l_lean_expander_mixfix_transform___closed__5() {
@ -3804,16 +3810,17 @@ return x_98;
obj* _init_l_lean_expander_reserve__mixfix_transform___closed__1() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string("reserve");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* l_lean_expander_reserve__mixfix_transform(obj* x_0, obj* x_1) {
@ -3888,106 +3895,113 @@ return x_30;
obj* _init_l_lean_expander_mk__simple__binder___closed__1() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string(" : ");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* _init_l_lean_expander_mk__simple__binder___closed__2() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string("{");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* _init_l_lean_expander_mk__simple__binder___closed__3() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string("}");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* _init_l_lean_expander_mk__simple__binder___closed__4() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string("\xe2\xa6\x83");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* _init_l_lean_expander_mk__simple__binder___closed__5() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string("\xe2\xa6\x84");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* _init_l_lean_expander_mk__simple__binder___closed__6() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string("[");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* _init_l_lean_expander_mk__simple__binder___closed__7() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string("]");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* l_lean_expander_mk__simple__binder(obj* x_0, uint8 x_1, obj* x_2) {
@ -4140,7 +4154,7 @@ return x_1;
obj* _init_l_lean_expander_get__opt__type___main___closed__1() {
_start:
{
obj* x_0; obj* x_1; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9;
obj* x_0; obj* x_1; obj* x_4; obj* x_5; obj* x_6; obj* x_8; obj* x_9; obj* x_10;
x_0 = l_lean_parser_term_hole_has__view;
x_1 = lean::cnstr_get(x_0, 1);
lean::inc(x_1);
@ -4148,13 +4162,14 @@ lean::dec(x_0);
x_4 = lean::box(0);
x_5 = lean::mk_string("_");
x_6 = l_string_trim(x_5);
x_7 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_7, 0, x_4);
lean::cnstr_set(x_7, 1, x_6);
x_8 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_8, 0, x_7);
x_9 = lean::apply_1(x_1, x_8);
return x_9;
lean::dec(x_5);
x_8 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_8, 0, x_4);
lean::cnstr_set(x_8, 1, x_6);
x_9 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_9, 0, x_8);
x_10 = lean::apply_1(x_1, x_9);
return x_10;
}
}
obj* l_lean_expander_get__opt__type___main(obj* x_0) {
@ -5219,20 +5234,22 @@ _start:
obj* x_0; obj* x_1;
x_0 = lean::mk_string(" : ");
x_1 = l_string_trim(x_0);
lean::dec(x_0);
return x_1;
}
}
obj* _init_l_lean_expander_expand__bracketed__binder___main___closed__11() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3;
obj* x_0; obj* x_1; obj* x_2; obj* x_4;
x_0 = lean::box(0);
x_1 = lean::mk_string(" : ");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
return x_3;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
return x_4;
}
}
obj* _init_l_lean_expander_expand__bracketed__binder___main___closed__12() {
@ -6920,16 +6937,17 @@ return x_13;
obj* _init_l_list_mfoldr___main___at_lean_expander_expand__binders___spec__6___closed__1() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string("match ");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* _init_l_list_mfoldr___main___at_lean_expander_expand__binders___spec__6___closed__2() {
@ -6972,22 +6990,23 @@ return x_18;
obj* _init_l_list_mfoldr___main___at_lean_expander_expand__binders___spec__6___closed__3() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string(" with ");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* _init_l_list_mfoldr___main___at_lean_expander_expand__binders___spec__6___closed__4() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_6; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; uint8 x_20; obj* x_21; obj* x_22;
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_6; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_15; obj* x_16; obj* x_18; obj* x_19; obj* x_20; uint8 x_21; obj* x_22; obj* x_23;
x_0 = lean::box(0);
x_1 = lean::mk_string("x");
x_2 = lean_name_mk_string(x_0, x_1);
@ -7010,17 +7029,18 @@ lean::inc(x_12);
lean::dec(x_11);
x_15 = lean::mk_string("_");
x_16 = l_string_trim(x_15);
x_17 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_17, 0, x_3);
lean::cnstr_set(x_17, 1, x_16);
x_18 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_18, 0, x_17);
x_19 = lean::apply_1(x_12, x_18);
x_20 = 0;
x_21 = l_lean_expander_mk__simple__binder(x_10, x_20, x_19);
x_22 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_22, 0, x_21);
return x_22;
lean::dec(x_15);
x_18 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_18, 0, x_3);
lean::cnstr_set(x_18, 1, x_16);
x_19 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_19, 0, x_18);
x_20 = lean::apply_1(x_12, x_19);
x_21 = 0;
x_22 = l_lean_expander_mk__simple__binder(x_10, x_21, x_20);
x_23 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_23, 0, x_22);
return x_23;
}
}
obj* l_list_mfoldr___main___at_lean_expander_expand__binders___spec__6(obj* x_0, obj* x_1, obj* x_2, obj* x_3) {
@ -7322,35 +7342,38 @@ _start:
obj* x_0; obj* x_1;
x_0 = lean::mk_string("_");
x_1 = l_string_trim(x_0);
lean::dec(x_0);
return x_1;
}
}
obj* _init_l_lean_expander_expand__binders___closed__3() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3;
obj* x_0; obj* x_1; obj* x_2; obj* x_4;
x_0 = lean::box(0);
x_1 = lean::mk_string("_");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
return x_3;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
return x_4;
}
}
obj* _init_l_lean_expander_expand__binders___closed__4() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string("_");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* l_lean_expander_expand__binders(obj* x_0, obj* x_1, obj* x_2, obj* x_3) {
@ -8735,33 +8758,35 @@ return x_9;
obj* _init_l_lean_expander_let_transform___closed__1() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_10; obj* x_11; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17;
x_0 = lean::box(0);
x_1 = lean::mk_string(" : ");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
x_5 = l_lean_parser_term_hole_has__view;
x_6 = lean::cnstr_get(x_5, 1);
lean::inc(x_6);
lean::dec(x_5);
x_9 = lean::mk_string("_");
x_10 = l_string_trim(x_9);
x_11 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_11, 0, x_0);
lean::cnstr_set(x_11, 1, x_10);
x_12 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_12, 0, x_11);
x_13 = lean::apply_1(x_6, x_12);
x_14 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_14, 0, x_4);
lean::cnstr_set(x_14, 1, x_13);
x_15 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_15, 0, x_14);
return x_15;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
x_6 = l_lean_parser_term_hole_has__view;
x_7 = lean::cnstr_get(x_6, 1);
lean::inc(x_7);
lean::dec(x_6);
x_10 = lean::mk_string("_");
x_11 = l_string_trim(x_10);
lean::dec(x_10);
x_13 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_13, 0, x_0);
lean::cnstr_set(x_13, 1, x_11);
x_14 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_14, 0, x_13);
x_15 = lean::apply_1(x_7, x_14);
x_16 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_16, 0, x_5);
lean::cnstr_set(x_16, 1, x_15);
x_17 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_17, 0, x_16);
return x_17;
}
}
obj* l_lean_expander_let_transform(obj* x_0, obj* x_1) {
@ -9190,28 +9215,30 @@ return x_2;
obj* _init_l_lean_expander_declaration_transform___closed__1() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_10; obj* x_11; obj* x_12;
x_0 = lean::box(0);
x_1 = lean::mk_string("@[");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
x_5 = lean::box(0);
x_6 = lean::mk_string("]");
x_7 = l_string_trim(x_6);
x_8 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_8, 0, x_0);
lean::cnstr_set(x_8, 1, x_7);
x_9 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_9, 0, x_8);
x_10 = lean::alloc_cnstr(0, 3, 0);
lean::cnstr_set(x_10, 0, x_4);
lean::cnstr_set(x_10, 1, x_5);
lean::cnstr_set(x_10, 2, x_9);
return x_10;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
x_6 = lean::box(0);
x_7 = lean::mk_string("]");
x_8 = l_string_trim(x_7);
lean::dec(x_7);
x_10 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_10, 0, x_0);
lean::cnstr_set(x_10, 1, x_8);
x_11 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_11, 0, x_10);
x_12 = lean::alloc_cnstr(0, 3, 0);
lean::cnstr_set(x_12, 0, x_5);
lean::cnstr_set(x_12, 1, x_6);
lean::cnstr_set(x_12, 2, x_11);
return x_12;
}
}
obj* _init_l_lean_expander_declaration_transform___closed__2() {
@ -9246,18 +9273,19 @@ return x_12;
obj* _init_l_lean_expander_declaration_transform___closed__3() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_5;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5; obj* x_6;
x_0 = lean::box(0);
x_1 = lean::mk_string("structure");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
x_5 = lean::alloc_cnstr(0, 1, 0);
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
x_6 = lean::alloc_cnstr(0, 1, 0);
lean::cnstr_set(x_6, 0, x_5);
return x_6;
}
}
obj* l_lean_expander_declaration_transform(obj* x_0, obj* x_1) {
@ -9717,16 +9745,17 @@ return x_2;
obj* _init_l_lean_expander_variable_transform___closed__1() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string("variables");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* l_lean_expander_variable_transform(obj* x_0, obj* x_1) {
@ -9905,51 +9934,53 @@ return x_0;
obj* _init_l_lean_expander_binding__annotation__update_parser_lean_parser_has__view() {
_start:
{
obj* x_0; obj* x_1; obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; obj* x_14;
obj* x_0; obj* x_1; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15;
x_0 = lean::mk_string("dummy");
x_1 = l_string_trim(x_0);
lean::dec(x_0);
lean::inc(x_1);
x_3 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_3, 0, x_1);
x_4 = lean::mk_nat_obj(0u);
x_5 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_command_notation__spec_precedence__term_parser_lean_parser_has__tokens___spec__1___boxed), 8, 3);
lean::closure_set(x_5, 0, x_1);
lean::closure_set(x_5, 1, x_4);
lean::closure_set(x_5, 2, x_3);
x_6 = lean::box(0);
x_7 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_7, 0, x_5);
lean::cnstr_set(x_7, 1, x_6);
x_8 = l_lean_parser_term__parser__m_monad;
x_9 = l_lean_parser_term__parser__m_monad__except;
x_10 = l_lean_parser_term__parser__m_lean_parser_monad__parsec;
x_11 = l_lean_parser_term__parser__m_alternative;
x_12 = l_lean_expander_binding__annotation__update;
x_13 = l_lean_expander_binding__annotation__update_has__view;
x_14 = l_lean_parser_combinators_node_view___rarg(x_8, x_9, x_10, x_11, x_12, x_7, x_13);
lean::dec(x_7);
return x_14;
x_4 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_4, 0, x_1);
x_5 = lean::mk_nat_obj(0u);
x_6 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_command_notation__spec_precedence__term_parser_lean_parser_has__tokens___spec__1___boxed), 8, 3);
lean::closure_set(x_6, 0, x_1);
lean::closure_set(x_6, 1, x_5);
lean::closure_set(x_6, 2, x_4);
x_7 = lean::box(0);
x_8 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_8, 0, x_6);
lean::cnstr_set(x_8, 1, x_7);
x_9 = l_lean_parser_term__parser__m_monad;
x_10 = l_lean_parser_term__parser__m_monad__except;
x_11 = l_lean_parser_term__parser__m_lean_parser_monad__parsec;
x_12 = l_lean_parser_term__parser__m_alternative;
x_13 = l_lean_expander_binding__annotation__update;
x_14 = l_lean_expander_binding__annotation__update_has__view;
x_15 = l_lean_parser_combinators_node_view___rarg(x_9, x_10, x_11, x_12, x_13, x_8, x_14);
lean::dec(x_8);
return x_15;
}
}
obj* _init_l_lean_expander_binding__annotation__update_parser___closed__1() {
_start:
{
obj* x_0; obj* x_1; obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_7;
obj* x_0; obj* x_1; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8;
x_0 = lean::mk_string("dummy");
x_1 = l_string_trim(x_0);
lean::dec(x_0);
lean::inc(x_1);
x_3 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_3, 0, x_1);
x_4 = lean::mk_nat_obj(0u);
x_5 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_command_notation__spec_precedence__term_parser_lean_parser_has__tokens___spec__1___boxed), 8, 3);
lean::closure_set(x_5, 0, x_1);
lean::closure_set(x_5, 1, x_4);
lean::closure_set(x_5, 2, x_3);
x_6 = lean::box(0);
x_7 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_7, 0, x_5);
lean::cnstr_set(x_7, 1, x_6);
return x_7;
x_4 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_4, 0, x_1);
x_5 = lean::mk_nat_obj(0u);
x_6 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_command_notation__spec_precedence__term_parser_lean_parser_has__tokens___spec__1___boxed), 8, 3);
lean::closure_set(x_6, 0, x_1);
lean::closure_set(x_6, 1, x_5);
lean::closure_set(x_6, 2, x_4);
x_7 = lean::box(0);
x_8 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_8, 0, x_6);
lean::cnstr_set(x_8, 1, x_7);
return x_8;
}
}
obj* l_lean_expander_binding__annotation__update_parser(obj* x_0, obj* x_1, obj* x_2, obj* x_3, obj* x_4) {
@ -9965,33 +9996,35 @@ return x_7;
obj* _init_l_list_mmap___main___at_lean_expander_variables_transform___spec__1___closed__1() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_10; obj* x_11; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17;
x_0 = lean::box(0);
x_1 = lean::mk_string(" : ");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
x_5 = l_lean_expander_binding__annotation__update_has__view;
x_6 = lean::cnstr_get(x_5, 1);
lean::inc(x_6);
lean::dec(x_5);
x_9 = lean::mk_string("dummy");
x_10 = l_string_trim(x_9);
x_11 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_11, 0, x_0);
lean::cnstr_set(x_11, 1, x_10);
x_12 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_12, 0, x_11);
x_13 = lean::apply_1(x_6, x_12);
x_14 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_14, 0, x_4);
lean::cnstr_set(x_14, 1, x_13);
x_15 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_15, 0, x_14);
return x_15;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
x_6 = l_lean_expander_binding__annotation__update_has__view;
x_7 = lean::cnstr_get(x_6, 1);
lean::inc(x_7);
lean::dec(x_6);
x_10 = lean::mk_string("dummy");
x_11 = l_string_trim(x_10);
lean::dec(x_10);
x_13 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_13, 0, x_0);
lean::cnstr_set(x_13, 1, x_11);
x_14 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_14, 0, x_13);
x_15 = lean::apply_1(x_7, x_14);
x_16 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_16, 0, x_5);
lean::cnstr_set(x_16, 1, x_15);
x_17 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_17, 0, x_16);
return x_17;
}
}
obj* l_list_mmap___main___at_lean_expander_variables_transform___spec__1(obj* x_0, obj* x_1) {
@ -10446,16 +10479,17 @@ return x_2;
obj* _init_l_list_map___main___at_lean_expander_universes_transform___spec__1___closed__1() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5;
x_0 = lean::box(0);
x_1 = lean::mk_string("universe");
x_2 = l_string_trim(x_1);
x_3 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_3, 0, x_0);
lean::cnstr_set(x_3, 1, x_2);
x_4 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_4, 0, x_3);
return x_4;
lean::dec(x_1);
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_0);
lean::cnstr_set(x_4, 1, x_2);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
obj* l_list_map___main___at_lean_expander_universes_transform___spec__1(obj* x_0) {
@ -10535,7 +10569,7 @@ return x_2;
obj* _init_l_lean_expander_sorry_transform___closed__1() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; obj* x_20; obj* x_21; obj* x_22; obj* x_23; obj* x_24;
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_8; obj* x_9; obj* x_10; obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; obj* x_20; obj* x_21; obj* x_22; obj* x_23; obj* x_24; obj* x_25;
x_0 = lean::box(0);
x_1 = lean::mk_string("sorry_ax");
x_2 = lean_name_mk_string(x_0, x_1);
@ -10547,30 +10581,31 @@ lean::dec(x_4);
x_8 = lean::box(0);
x_9 = lean::mk_string("_");
x_10 = l_string_trim(x_9);
x_11 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_11, 0, x_8);
lean::cnstr_set(x_11, 1, x_10);
x_12 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_12, 0, x_11);
x_13 = lean::apply_1(x_5, x_12);
x_14 = lean::mk_string("bool");
x_15 = lean_name_mk_string(x_0, x_14);
x_16 = lean::mk_string("ff");
x_17 = lean_name_mk_string(x_15, x_16);
x_18 = l_lean_expander_glob__id(x_17);
x_19 = lean::box(0);
x_20 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_20, 0, x_18);
lean::cnstr_set(x_20, 1, x_19);
lean::dec(x_9);
x_12 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_12, 0, x_8);
lean::cnstr_set(x_12, 1, x_10);
x_13 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_13, 0, x_12);
x_14 = lean::apply_1(x_5, x_13);
x_15 = lean::mk_string("bool");
x_16 = lean_name_mk_string(x_0, x_15);
x_17 = lean::mk_string("ff");
x_18 = lean_name_mk_string(x_16, x_17);
x_19 = l_lean_expander_glob__id(x_18);
x_20 = lean::box(0);
x_21 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_21, 0, x_13);
lean::cnstr_set(x_21, 0, x_19);
lean::cnstr_set(x_21, 1, x_20);
x_22 = l_list_foldl___main___at_lean_parser_term_mk__app___spec__1(x_3, x_21);
x_23 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_23, 0, x_22);
x_22 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_22, 0, x_14);
lean::cnstr_set(x_22, 1, x_21);
x_23 = l_list_foldl___main___at_lean_parser_term_mk__app___spec__1(x_3, x_22);
x_24 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_24, 0, x_23);
return x_24;
x_25 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_25, 0, x_24);
return x_25;
}
}
obj* l_lean_expander_sorry_transform(obj* x_0, obj* x_1) {

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1506,25 +1506,27 @@ return x_129;
obj* _init_l_lean_parser_level_paren_parser_lean_parser_has__tokens() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_9; obj* x_10; obj* x_12; obj* x_15;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5; obj* x_6; obj* x_8; obj* x_9; obj* x_11; obj* x_12; obj* x_14; obj* x_17;
x_0 = lean::mk_string("(");
x_1 = l_lean_parser_max__prec;
x_2 = l_lean_parser_symbol_tokens___rarg(x_0, x_1);
x_3 = lean::mk_string(")");
x_4 = lean::mk_nat_obj(0u);
x_5 = l_lean_parser_symbol_tokens___rarg(x_3, x_4);
x_6 = lean::box(0);
x_7 = l_lean_parser_list_cons_tokens___rarg(x_5, x_6);
lean::dec(x_5);
x_9 = l_lean_parser_level_parser_lean_parser_has__tokens___closed__1;
x_10 = l_lean_parser_list_cons_tokens___rarg(x_9, x_7);
lean::dec(x_7);
x_12 = l_lean_parser_list_cons_tokens___rarg(x_2, x_10);
lean::dec(x_10);
lean::dec(x_2);
x_15 = l_lean_parser_tokens___rarg(x_12);
lean::dec(x_0);
x_4 = lean::mk_string(")");
x_5 = lean::mk_nat_obj(0u);
x_6 = l_lean_parser_symbol_tokens___rarg(x_4, x_5);
lean::dec(x_4);
x_8 = lean::box(0);
x_9 = l_lean_parser_list_cons_tokens___rarg(x_6, x_8);
lean::dec(x_6);
x_11 = l_lean_parser_level_parser_lean_parser_has__tokens___closed__1;
x_12 = l_lean_parser_list_cons_tokens___rarg(x_11, x_9);
lean::dec(x_9);
x_14 = l_lean_parser_list_cons_tokens___rarg(x_2, x_12);
lean::dec(x_12);
return x_15;
lean::dec(x_2);
x_17 = l_lean_parser_tokens___rarg(x_14);
lean::dec(x_14);
return x_17;
}
}
obj* l_lean_parser_symbol__core___at_lean_parser_level_paren_parser_lean_parser_has__tokens___spec__1___boxed(obj* x_0, obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5, obj* x_6) {
@ -1540,48 +1542,50 @@ return x_7;
obj* _init_l_lean_parser_level_paren_parser_lean_parser_has__view() {
_start:
{
obj* x_0; obj* x_1; obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; obj* x_20; obj* x_21; obj* x_22; obj* x_23;
obj* x_0; obj* x_1; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; obj* x_20; obj* x_21; obj* x_22; obj* x_23; obj* x_24; obj* x_25;
x_0 = lean::mk_string("(");
x_1 = l_string_trim(x_0);
lean::dec(x_0);
lean::inc(x_1);
x_3 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_3, 0, x_1);
x_4 = l_lean_parser_max__prec;
x_5 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_level_paren_parser_lean_parser_has__tokens___spec__1___boxed), 7, 3);
lean::closure_set(x_5, 0, x_1);
lean::closure_set(x_5, 1, x_4);
lean::closure_set(x_5, 2, x_3);
x_6 = lean::mk_nat_obj(0u);
x_7 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_level_parser), 5, 1);
lean::closure_set(x_7, 0, x_6);
x_8 = lean::mk_string(")");
x_9 = l_string_trim(x_8);
lean::inc(x_9);
x_11 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_11, 0, x_9);
x_12 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_level_paren_parser_lean_parser_has__tokens___spec__1___boxed), 7, 3);
lean::closure_set(x_12, 0, x_9);
lean::closure_set(x_12, 1, x_6);
lean::closure_set(x_12, 2, x_11);
x_13 = lean::box(0);
x_14 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_14, 0, x_12);
lean::cnstr_set(x_14, 1, x_13);
x_15 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_15, 0, x_7);
lean::cnstr_set(x_15, 1, x_14);
x_4 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_4, 0, x_1);
x_5 = l_lean_parser_max__prec;
x_6 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_level_paren_parser_lean_parser_has__tokens___spec__1___boxed), 7, 3);
lean::closure_set(x_6, 0, x_1);
lean::closure_set(x_6, 1, x_5);
lean::closure_set(x_6, 2, x_4);
x_7 = lean::mk_nat_obj(0u);
x_8 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_level_parser), 5, 1);
lean::closure_set(x_8, 0, x_7);
x_9 = lean::mk_string(")");
x_10 = l_string_trim(x_9);
lean::dec(x_9);
lean::inc(x_10);
x_13 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_13, 0, x_10);
x_14 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_level_paren_parser_lean_parser_has__tokens___spec__1___boxed), 7, 3);
lean::closure_set(x_14, 0, x_10);
lean::closure_set(x_14, 1, x_7);
lean::closure_set(x_14, 2, x_13);
x_15 = lean::box(0);
x_16 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_16, 0, x_5);
lean::cnstr_set(x_16, 0, x_14);
lean::cnstr_set(x_16, 1, x_15);
x_17 = l_lean_parser_level__parser__m_monad;
x_18 = l_lean_parser_level__parser__m_monad__except;
x_19 = l_lean_parser_level__parser__m_lean_parser_monad__parsec;
x_20 = l_lean_parser_level__parser__m_alternative;
x_21 = l_lean_parser_level_paren;
x_22 = l_lean_parser_level_paren_has__view;
x_23 = l_lean_parser_combinators_node_view___rarg(x_17, x_18, x_19, x_20, x_21, x_16, x_22);
lean::dec(x_16);
return x_23;
x_17 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_17, 0, x_8);
lean::cnstr_set(x_17, 1, x_16);
x_18 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_18, 0, x_6);
lean::cnstr_set(x_18, 1, x_17);
x_19 = l_lean_parser_level__parser__m_monad;
x_20 = l_lean_parser_level__parser__m_monad__except;
x_21 = l_lean_parser_level__parser__m_lean_parser_monad__parsec;
x_22 = l_lean_parser_level__parser__m_alternative;
x_23 = l_lean_parser_level_paren;
x_24 = l_lean_parser_level_paren_has__view;
x_25 = l_lean_parser_combinators_node_view___rarg(x_19, x_20, x_21, x_22, x_23, x_18, x_24);
lean::dec(x_18);
return x_25;
}
}
obj* l_list_mfoldl___main___at_lean_parser_level_paren_parser___spec__2(obj* x_0, obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5, obj* x_6) {
@ -1994,40 +1998,42 @@ return x_37;
obj* _init_l_lean_parser_level_paren_parser___closed__1() {
_start:
{
obj* x_0; obj* x_1; obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16;
obj* x_0; obj* x_1; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18;
x_0 = lean::mk_string("(");
x_1 = l_string_trim(x_0);
lean::dec(x_0);
lean::inc(x_1);
x_3 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_3, 0, x_1);
x_4 = l_lean_parser_max__prec;
x_5 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_level_paren_parser_lean_parser_has__tokens___spec__1___boxed), 7, 3);
lean::closure_set(x_5, 0, x_1);
lean::closure_set(x_5, 1, x_4);
lean::closure_set(x_5, 2, x_3);
x_6 = lean::mk_nat_obj(0u);
x_7 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_level_parser), 5, 1);
lean::closure_set(x_7, 0, x_6);
x_8 = lean::mk_string(")");
x_9 = l_string_trim(x_8);
lean::inc(x_9);
x_11 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_11, 0, x_9);
x_12 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_level_paren_parser_lean_parser_has__tokens___spec__1___boxed), 7, 3);
lean::closure_set(x_12, 0, x_9);
lean::closure_set(x_12, 1, x_6);
lean::closure_set(x_12, 2, x_11);
x_13 = lean::box(0);
x_14 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_14, 0, x_12);
lean::cnstr_set(x_14, 1, x_13);
x_15 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_15, 0, x_7);
lean::cnstr_set(x_15, 1, x_14);
x_4 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_4, 0, x_1);
x_5 = l_lean_parser_max__prec;
x_6 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_level_paren_parser_lean_parser_has__tokens___spec__1___boxed), 7, 3);
lean::closure_set(x_6, 0, x_1);
lean::closure_set(x_6, 1, x_5);
lean::closure_set(x_6, 2, x_4);
x_7 = lean::mk_nat_obj(0u);
x_8 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_level_parser), 5, 1);
lean::closure_set(x_8, 0, x_7);
x_9 = lean::mk_string(")");
x_10 = l_string_trim(x_9);
lean::dec(x_9);
lean::inc(x_10);
x_13 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_13, 0, x_10);
x_14 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_level_paren_parser_lean_parser_has__tokens___spec__1___boxed), 7, 3);
lean::closure_set(x_14, 0, x_10);
lean::closure_set(x_14, 1, x_7);
lean::closure_set(x_14, 2, x_13);
x_15 = lean::box(0);
x_16 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_16, 0, x_5);
lean::cnstr_set(x_16, 0, x_14);
lean::cnstr_set(x_16, 1, x_15);
return x_16;
x_17 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_17, 0, x_8);
lean::cnstr_set(x_17, 1, x_16);
x_18 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_18, 0, x_6);
lean::cnstr_set(x_18, 1, x_17);
return x_18;
}
}
obj* l_lean_parser_level_paren_parser(obj* x_0, obj* x_1, obj* x_2, obj* x_3) {
@ -3675,31 +3681,32 @@ return x_95;
obj* _init_l_lean_parser_level_leading_parser_lean_parser_has__tokens() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_7; obj* x_8; obj* x_10; obj* x_13; obj* x_15; obj* x_17; obj* x_19; obj* x_21;
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_5; obj* x_6; obj* x_8; obj* x_9; obj* x_11; obj* x_14; obj* x_16; obj* x_18; obj* x_20; obj* x_22;
x_0 = lean::box(0);
x_1 = lean::mk_string("_");
x_2 = l_lean_parser_max__prec;
x_3 = l_lean_parser_symbol_tokens___rarg(x_1, x_2);
x_4 = l_lean_parser_list_cons_tokens___rarg(x_0, x_0);
x_5 = l_lean_parser_list_cons_tokens___rarg(x_0, x_4);
lean::dec(x_4);
x_7 = l_lean_parser_level_paren_parser_lean_parser_has__tokens;
x_8 = l_lean_parser_list_cons_tokens___rarg(x_7, x_5);
lean::dec(x_1);
x_5 = l_lean_parser_list_cons_tokens___rarg(x_0, x_0);
x_6 = l_lean_parser_list_cons_tokens___rarg(x_0, x_5);
lean::dec(x_5);
x_10 = l_lean_parser_list_cons_tokens___rarg(x_3, x_8);
lean::dec(x_8);
x_8 = l_lean_parser_level_paren_parser_lean_parser_has__tokens;
x_9 = l_lean_parser_list_cons_tokens___rarg(x_8, x_6);
lean::dec(x_6);
x_11 = l_lean_parser_list_cons_tokens___rarg(x_3, x_9);
lean::dec(x_9);
lean::dec(x_3);
x_13 = l_lean_parser_list_cons_tokens___rarg(x_0, x_10);
lean::dec(x_10);
x_15 = l_lean_parser_list_cons_tokens___rarg(x_0, x_13);
lean::dec(x_13);
x_17 = l_lean_parser_tokens___rarg(x_15);
lean::dec(x_15);
x_19 = l_lean_parser_list_cons_tokens___rarg(x_17, x_0);
lean::dec(x_17);
x_21 = l_lean_parser_tokens___rarg(x_19);
lean::dec(x_19);
return x_21;
x_14 = l_lean_parser_list_cons_tokens___rarg(x_0, x_11);
lean::dec(x_11);
x_16 = l_lean_parser_list_cons_tokens___rarg(x_0, x_14);
lean::dec(x_14);
x_18 = l_lean_parser_tokens___rarg(x_16);
lean::dec(x_16);
x_20 = l_lean_parser_list_cons_tokens___rarg(x_18, x_0);
lean::dec(x_18);
x_22 = l_lean_parser_tokens___rarg(x_20);
lean::dec(x_20);
return x_22;
}
}
obj* l_lean_parser_symbol__or__ident___at_lean_parser_level_leading_parser_lean_parser_has__tokens___spec__1___boxed(obj* x_0, obj* x_1, obj* x_2, obj* x_3, obj* x_4) {
@ -3753,7 +3760,7 @@ return x_1;
obj* _init_l_lean_parser_level_leading_parser_lean_parser_has__view() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; obj* x_20; obj* x_21; obj* x_22; obj* x_23; obj* x_24; obj* x_25; obj* x_26; obj* x_27; obj* x_28; obj* x_29;
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; obj* x_20; obj* x_21; obj* x_22; obj* x_23; obj* x_24; obj* x_25; obj* x_26; obj* x_27; obj* x_28; obj* x_29; obj* x_30;
x_0 = lean::mk_string("max");
x_1 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__or__ident___at_lean_parser_level_leading_parser_lean_parser_has__tokens___spec__1___boxed), 5, 1);
lean::closure_set(x_1, 0, x_0);
@ -3762,58 +3769,59 @@ x_3 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__or__iden
lean::closure_set(x_3, 0, x_2);
x_4 = lean::mk_string("_");
x_5 = l_string_trim(x_4);
lean::dec(x_4);
lean::inc(x_5);
x_7 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_7, 0, x_5);
x_8 = l_lean_parser_max__prec;
x_9 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_level_paren_parser_lean_parser_has__tokens___spec__1___boxed), 7, 3);
lean::closure_set(x_9, 0, x_5);
lean::closure_set(x_9, 1, x_8);
lean::closure_set(x_9, 2, x_7);
x_10 = lean::box(0);
x_11 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_ident_parser___at_lean_parser_level_leading_parser_lean_parser_has__tokens___spec__3___boxed), 1, 0);
x_12 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_12, 0, x_11);
lean::cnstr_set(x_12, 1, x_10);
x_13 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_number_parser___at_lean_parser_level_leading_parser_lean_parser_has__tokens___spec__2___boxed), 1, 0);
x_14 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_14, 0, x_13);
lean::cnstr_set(x_14, 1, x_12);
x_15 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_level_paren_parser), 4, 0);
x_16 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_16, 0, x_15);
lean::cnstr_set(x_16, 1, x_14);
x_8 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_8, 0, x_5);
x_9 = l_lean_parser_max__prec;
x_10 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_level_paren_parser_lean_parser_has__tokens___spec__1___boxed), 7, 3);
lean::closure_set(x_10, 0, x_5);
lean::closure_set(x_10, 1, x_9);
lean::closure_set(x_10, 2, x_8);
x_11 = lean::box(0);
x_12 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_ident_parser___at_lean_parser_level_leading_parser_lean_parser_has__tokens___spec__3___boxed), 1, 0);
x_13 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_13, 0, x_12);
lean::cnstr_set(x_13, 1, x_11);
x_14 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_number_parser___at_lean_parser_level_leading_parser_lean_parser_has__tokens___spec__2___boxed), 1, 0);
x_15 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_15, 0, x_14);
lean::cnstr_set(x_15, 1, x_13);
x_16 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_level_paren_parser), 4, 0);
x_17 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_17, 0, x_9);
lean::cnstr_set(x_17, 1, x_16);
lean::cnstr_set(x_17, 0, x_16);
lean::cnstr_set(x_17, 1, x_15);
x_18 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_18, 0, x_3);
lean::cnstr_set(x_18, 0, x_10);
lean::cnstr_set(x_18, 1, x_17);
x_19 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_19, 0, x_1);
lean::cnstr_set(x_19, 0, x_3);
lean::cnstr_set(x_19, 1, x_18);
x_20 = lean::mk_nat_obj(0u);
x_21 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_combinators_choice__aux___main___at_lean_parser_level_leading_parser_lean_parser_has__tokens___spec__4), 6, 2);
lean::closure_set(x_21, 0, x_19);
lean::closure_set(x_21, 1, x_20);
x_22 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_22, 0, x_21);
lean::cnstr_set(x_22, 1, x_10);
x_23 = l_lean_parser_level__parser__m_monad;
x_24 = l_lean_parser_level__parser__m_monad__except;
x_25 = l_lean_parser_level__parser__m_lean_parser_monad__parsec;
x_26 = l_lean_parser_level__parser__m_alternative;
x_27 = l_lean_parser_level_leading;
x_28 = l_lean_parser_level_leading_has__view;
x_29 = l_lean_parser_combinators_node_view___rarg(x_23, x_24, x_25, x_26, x_27, x_22, x_28);
lean::dec(x_22);
return x_29;
x_20 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_20, 0, x_1);
lean::cnstr_set(x_20, 1, x_19);
x_21 = lean::mk_nat_obj(0u);
x_22 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_combinators_choice__aux___main___at_lean_parser_level_leading_parser_lean_parser_has__tokens___spec__4), 6, 2);
lean::closure_set(x_22, 0, x_20);
lean::closure_set(x_22, 1, x_21);
x_23 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_23, 0, x_22);
lean::cnstr_set(x_23, 1, x_11);
x_24 = l_lean_parser_level__parser__m_monad;
x_25 = l_lean_parser_level__parser__m_monad__except;
x_26 = l_lean_parser_level__parser__m_lean_parser_monad__parsec;
x_27 = l_lean_parser_level__parser__m_alternative;
x_28 = l_lean_parser_level_leading;
x_29 = l_lean_parser_level_leading_has__view;
x_30 = l_lean_parser_combinators_node_view___rarg(x_24, x_25, x_26, x_27, x_28, x_23, x_29);
lean::dec(x_23);
return x_30;
}
}
obj* _init_l_lean_parser_level_leading_parser___closed__1() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; obj* x_20; obj* x_21; obj* x_22;
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; obj* x_20; obj* x_21; obj* x_22; obj* x_23;
x_0 = lean::mk_string("max");
x_1 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__or__ident___at_lean_parser_level_leading_parser_lean_parser_has__tokens___spec__1___boxed), 5, 1);
lean::closure_set(x_1, 0, x_0);
@ -3822,44 +3830,45 @@ x_3 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__or__iden
lean::closure_set(x_3, 0, x_2);
x_4 = lean::mk_string("_");
x_5 = l_string_trim(x_4);
lean::dec(x_4);
lean::inc(x_5);
x_7 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_7, 0, x_5);
x_8 = l_lean_parser_max__prec;
x_9 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_level_paren_parser_lean_parser_has__tokens___spec__1___boxed), 7, 3);
lean::closure_set(x_9, 0, x_5);
lean::closure_set(x_9, 1, x_8);
lean::closure_set(x_9, 2, x_7);
x_10 = lean::box(0);
x_11 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_ident_parser___at_lean_parser_level_leading_parser_lean_parser_has__tokens___spec__3___boxed), 1, 0);
x_12 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_12, 0, x_11);
lean::cnstr_set(x_12, 1, x_10);
x_13 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_number_parser___at_lean_parser_level_leading_parser_lean_parser_has__tokens___spec__2___boxed), 1, 0);
x_14 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_14, 0, x_13);
lean::cnstr_set(x_14, 1, x_12);
x_15 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_level_paren_parser), 4, 0);
x_16 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_16, 0, x_15);
lean::cnstr_set(x_16, 1, x_14);
x_8 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_8, 0, x_5);
x_9 = l_lean_parser_max__prec;
x_10 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_level_paren_parser_lean_parser_has__tokens___spec__1___boxed), 7, 3);
lean::closure_set(x_10, 0, x_5);
lean::closure_set(x_10, 1, x_9);
lean::closure_set(x_10, 2, x_8);
x_11 = lean::box(0);
x_12 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_ident_parser___at_lean_parser_level_leading_parser_lean_parser_has__tokens___spec__3___boxed), 1, 0);
x_13 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_13, 0, x_12);
lean::cnstr_set(x_13, 1, x_11);
x_14 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_number_parser___at_lean_parser_level_leading_parser_lean_parser_has__tokens___spec__2___boxed), 1, 0);
x_15 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_15, 0, x_14);
lean::cnstr_set(x_15, 1, x_13);
x_16 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_level_paren_parser), 4, 0);
x_17 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_17, 0, x_9);
lean::cnstr_set(x_17, 1, x_16);
lean::cnstr_set(x_17, 0, x_16);
lean::cnstr_set(x_17, 1, x_15);
x_18 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_18, 0, x_3);
lean::cnstr_set(x_18, 0, x_10);
lean::cnstr_set(x_18, 1, x_17);
x_19 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_19, 0, x_1);
lean::cnstr_set(x_19, 0, x_3);
lean::cnstr_set(x_19, 1, x_18);
x_20 = lean::mk_nat_obj(0u);
x_21 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_combinators_choice__aux___main___at_lean_parser_level_leading_parser_lean_parser_has__tokens___spec__4), 6, 2);
lean::closure_set(x_21, 0, x_19);
lean::closure_set(x_21, 1, x_20);
x_22 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_22, 0, x_21);
lean::cnstr_set(x_22, 1, x_10);
return x_22;
x_20 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_20, 0, x_1);
lean::cnstr_set(x_20, 1, x_19);
x_21 = lean::mk_nat_obj(0u);
x_22 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_combinators_choice__aux___main___at_lean_parser_level_leading_parser_lean_parser_has__tokens___spec__4), 6, 2);
lean::closure_set(x_22, 0, x_20);
lean::closure_set(x_22, 1, x_21);
x_23 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_23, 0, x_22);
lean::cnstr_set(x_23, 1, x_11);
return x_23;
}
}
obj* l_lean_parser_level_leading_parser(obj* x_0, obj* x_1, obj* x_2, obj* x_3) {
@ -5396,21 +5405,22 @@ return x_2;
obj* _init_l_lean_parser_level_add__lit_parser_lean_parser_has__tokens() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_8; obj* x_9; obj* x_11;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5; obj* x_6; obj* x_9; obj* x_10; obj* x_12;
x_0 = lean::mk_string("+");
x_1 = lean::mk_nat_obj(0u);
x_2 = l_lean_parser_symbol_tokens___rarg(x_0, x_1);
x_3 = lean::box(0);
x_4 = l_lean_parser_list_cons_tokens___rarg(x_3, x_3);
x_5 = l_lean_parser_list_cons_tokens___rarg(x_2, x_4);
lean::dec(x_4);
lean::dec(x_2);
x_8 = l_lean_parser_level_lean_parser_has__tokens;
x_9 = l_lean_parser_list_cons_tokens___rarg(x_8, x_5);
lean::dec(x_0);
x_4 = lean::box(0);
x_5 = l_lean_parser_list_cons_tokens___rarg(x_4, x_4);
x_6 = l_lean_parser_list_cons_tokens___rarg(x_2, x_5);
lean::dec(x_5);
x_11 = l_lean_parser_tokens___rarg(x_9);
lean::dec(x_9);
return x_11;
lean::dec(x_2);
x_9 = l_lean_parser_level_lean_parser_has__tokens;
x_10 = l_lean_parser_list_cons_tokens___rarg(x_9, x_6);
lean::dec(x_6);
x_12 = l_lean_parser_tokens___rarg(x_10);
lean::dec(x_10);
return x_12;
}
}
obj* l_lean_parser_symbol__core___at_lean_parser_level_add__lit_parser_lean_parser_has__tokens___spec__1___boxed(obj* x_0, obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5, obj* x_6, obj* x_7) {
@ -5437,67 +5447,69 @@ return x_2;
obj* _init_l_lean_parser_level_add__lit_parser_lean_parser_has__view() {
_start:
{
obj* x_0; obj* x_1; obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18;
obj* x_0; obj* x_1; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19;
x_0 = lean::mk_string("+");
x_1 = l_string_trim(x_0);
lean::dec(x_0);
lean::inc(x_1);
x_3 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_3, 0, x_1);
x_4 = lean::mk_nat_obj(0u);
x_5 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_level_add__lit_parser_lean_parser_has__tokens___spec__1___boxed), 8, 3);
lean::closure_set(x_5, 0, x_1);
lean::closure_set(x_5, 1, x_4);
lean::closure_set(x_5, 2, x_3);
x_6 = lean::box(0);
x_7 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_number_parser___at_lean_parser_level_add__lit_parser_lean_parser_has__tokens___spec__2___boxed), 2, 0);
x_8 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_8, 0, x_7);
lean::cnstr_set(x_8, 1, x_6);
x_4 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_4, 0, x_1);
x_5 = lean::mk_nat_obj(0u);
x_6 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_level_add__lit_parser_lean_parser_has__tokens___spec__1___boxed), 8, 3);
lean::closure_set(x_6, 0, x_1);
lean::closure_set(x_6, 1, x_5);
lean::closure_set(x_6, 2, x_4);
x_7 = lean::box(0);
x_8 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_number_parser___at_lean_parser_level_add__lit_parser_lean_parser_has__tokens___spec__2___boxed), 2, 0);
x_9 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_9, 0, x_5);
lean::cnstr_set(x_9, 1, x_8);
x_10 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_level_get__leading___boxed), 5, 0);
x_11 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_11, 0, x_10);
lean::cnstr_set(x_11, 1, x_9);
x_12 = l_lean_parser_trailing__level__parser__m_monad;
x_13 = l_lean_parser_trailing__level__parser__m_monad__except;
x_14 = l_lean_parser_trailing__level__parser__m_lean_parser_monad__parsec;
x_15 = l_lean_parser_trailing__level__parser__m_alternative;
x_16 = l_lean_parser_level_add__lit;
x_17 = l_lean_parser_level_add__lit_has__view;
x_18 = l_lean_parser_combinators_node_view___rarg(x_12, x_13, x_14, x_15, x_16, x_11, x_17);
lean::dec(x_11);
return x_18;
lean::cnstr_set(x_9, 0, x_8);
lean::cnstr_set(x_9, 1, x_7);
x_10 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_10, 0, x_6);
lean::cnstr_set(x_10, 1, x_9);
x_11 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_level_get__leading___boxed), 5, 0);
x_12 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_12, 0, x_11);
lean::cnstr_set(x_12, 1, x_10);
x_13 = l_lean_parser_trailing__level__parser__m_monad;
x_14 = l_lean_parser_trailing__level__parser__m_monad__except;
x_15 = l_lean_parser_trailing__level__parser__m_lean_parser_monad__parsec;
x_16 = l_lean_parser_trailing__level__parser__m_alternative;
x_17 = l_lean_parser_level_add__lit;
x_18 = l_lean_parser_level_add__lit_has__view;
x_19 = l_lean_parser_combinators_node_view___rarg(x_13, x_14, x_15, x_16, x_17, x_12, x_18);
lean::dec(x_12);
return x_19;
}
}
obj* _init_l_lean_parser_level_add__lit_parser___closed__1() {
_start:
{
obj* x_0; obj* x_1; obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11;
obj* x_0; obj* x_1; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12;
x_0 = lean::mk_string("+");
x_1 = l_string_trim(x_0);
lean::dec(x_0);
lean::inc(x_1);
x_3 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_3, 0, x_1);
x_4 = lean::mk_nat_obj(0u);
x_5 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_level_add__lit_parser_lean_parser_has__tokens___spec__1___boxed), 8, 3);
lean::closure_set(x_5, 0, x_1);
lean::closure_set(x_5, 1, x_4);
lean::closure_set(x_5, 2, x_3);
x_6 = lean::box(0);
x_7 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_number_parser___at_lean_parser_level_add__lit_parser_lean_parser_has__tokens___spec__2___boxed), 2, 0);
x_8 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_8, 0, x_7);
lean::cnstr_set(x_8, 1, x_6);
x_4 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_4, 0, x_1);
x_5 = lean::mk_nat_obj(0u);
x_6 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_level_add__lit_parser_lean_parser_has__tokens___spec__1___boxed), 8, 3);
lean::closure_set(x_6, 0, x_1);
lean::closure_set(x_6, 1, x_5);
lean::closure_set(x_6, 2, x_4);
x_7 = lean::box(0);
x_8 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_number_parser___at_lean_parser_level_add__lit_parser_lean_parser_has__tokens___spec__2___boxed), 2, 0);
x_9 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_9, 0, x_5);
lean::cnstr_set(x_9, 1, x_8);
x_10 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_level_get__leading___boxed), 5, 0);
x_11 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_11, 0, x_10);
lean::cnstr_set(x_11, 1, x_9);
return x_11;
lean::cnstr_set(x_9, 0, x_8);
lean::cnstr_set(x_9, 1, x_7);
x_10 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_10, 0, x_6);
lean::cnstr_set(x_10, 1, x_9);
x_11 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_level_get__leading___boxed), 5, 0);
x_12 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_12, 0, x_11);
lean::cnstr_set(x_12, 1, x_10);
return x_12;
}
}
obj* l_lean_parser_level_add__lit_parser(obj* x_0, obj* x_1, obj* x_2, obj* x_3, obj* x_4) {

View file

@ -703,66 +703,69 @@ return x_0;
obj* _init_l_lean_parser_module_prelude_parser_lean_parser_has__view() {
_start:
{
obj* x_0; obj* x_1; obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; obj* x_14;
obj* x_0; obj* x_1; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15;
x_0 = lean::mk_string("prelude");
x_1 = l_string_trim(x_0);
lean::dec(x_0);
lean::inc(x_1);
x_3 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_3, 0, x_1);
x_4 = lean::mk_nat_obj(0u);
x_5 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_unicode__symbol_lean_parser_has__tokens___spec__1___boxed), 6, 3);
lean::closure_set(x_5, 0, x_1);
lean::closure_set(x_5, 1, x_4);
lean::closure_set(x_5, 2, x_3);
x_6 = lean::box(0);
x_7 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_7, 0, x_5);
lean::cnstr_set(x_7, 1, x_6);
x_8 = l_lean_parser_basic__parser__m_monad;
x_9 = l_lean_parser_basic__parser__m_monad__except;
x_10 = l_lean_parser_basic__parser__m_lean_parser_monad__parsec;
x_11 = l_lean_parser_basic__parser__m_alternative;
x_12 = l_lean_parser_module_prelude;
x_13 = l_lean_parser_module_prelude_has__view;
x_14 = l_lean_parser_combinators_node_view___rarg(x_8, x_9, x_10, x_11, x_12, x_7, x_13);
lean::dec(x_7);
return x_14;
x_4 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_4, 0, x_1);
x_5 = lean::mk_nat_obj(0u);
x_6 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_unicode__symbol_lean_parser_has__tokens___spec__1___boxed), 6, 3);
lean::closure_set(x_6, 0, x_1);
lean::closure_set(x_6, 1, x_5);
lean::closure_set(x_6, 2, x_4);
x_7 = lean::box(0);
x_8 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_8, 0, x_6);
lean::cnstr_set(x_8, 1, x_7);
x_9 = l_lean_parser_basic__parser__m_monad;
x_10 = l_lean_parser_basic__parser__m_monad__except;
x_11 = l_lean_parser_basic__parser__m_lean_parser_monad__parsec;
x_12 = l_lean_parser_basic__parser__m_alternative;
x_13 = l_lean_parser_module_prelude;
x_14 = l_lean_parser_module_prelude_has__view;
x_15 = l_lean_parser_combinators_node_view___rarg(x_9, x_10, x_11, x_12, x_13, x_8, x_14);
lean::dec(x_8);
return x_15;
}
}
obj* _init_l_lean_parser_module_prelude_parser_lean_parser_has__tokens() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_6;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5; obj* x_7;
x_0 = lean::mk_string("prelude");
x_1 = lean::mk_nat_obj(0u);
x_2 = l_lean_parser_symbol_tokens___rarg(x_0, x_1);
x_3 = lean::box(0);
x_4 = l_lean_parser_list_cons_tokens___rarg(x_2, x_3);
lean::dec(x_0);
x_4 = lean::box(0);
x_5 = l_lean_parser_list_cons_tokens___rarg(x_2, x_4);
lean::dec(x_2);
x_6 = l_lean_parser_tokens___rarg(x_4);
lean::dec(x_4);
return x_6;
x_7 = l_lean_parser_tokens___rarg(x_5);
lean::dec(x_5);
return x_7;
}
}
obj* _init_l_lean_parser_module_prelude_parser___closed__1() {
_start:
{
obj* x_0; obj* x_1; obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_7;
obj* x_0; obj* x_1; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8;
x_0 = lean::mk_string("prelude");
x_1 = l_string_trim(x_0);
lean::dec(x_0);
lean::inc(x_1);
x_3 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_3, 0, x_1);
x_4 = lean::mk_nat_obj(0u);
x_5 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_unicode__symbol_lean_parser_has__tokens___spec__1___boxed), 6, 3);
lean::closure_set(x_5, 0, x_1);
lean::closure_set(x_5, 1, x_4);
lean::closure_set(x_5, 2, x_3);
x_6 = lean::box(0);
x_7 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_7, 0, x_5);
lean::cnstr_set(x_7, 1, x_6);
return x_7;
x_4 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_4, 0, x_1);
x_5 = lean::mk_nat_obj(0u);
x_6 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_unicode__symbol_lean_parser_has__tokens___spec__1___boxed), 6, 3);
lean::closure_set(x_6, 0, x_1);
lean::closure_set(x_6, 1, x_5);
lean::closure_set(x_6, 2, x_4);
x_7 = lean::box(0);
x_8 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_8, 0, x_6);
lean::cnstr_set(x_8, 1, x_7);
return x_8;
}
}
obj* l_lean_parser_module_prelude_parser(obj* x_0, obj* x_1, obj* x_2) {
@ -2136,83 +2139,86 @@ return x_0;
obj* _init_l_lean_parser_module_import_parser_lean_parser_has__view() {
_start:
{
obj* x_0; obj* x_1; obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17;
obj* x_0; obj* x_1; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18;
x_0 = lean::mk_string("import");
x_1 = l_string_trim(x_0);
lean::dec(x_0);
lean::inc(x_1);
x_3 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_3, 0, x_1);
x_4 = lean::mk_nat_obj(0u);
x_5 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_unicode__symbol_lean_parser_has__tokens___spec__1___boxed), 6, 3);
lean::closure_set(x_5, 0, x_1);
lean::closure_set(x_5, 1, x_4);
lean::closure_set(x_5, 2, x_3);
x_6 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_module_import__path_parser), 3, 0);
x_7 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_combinators_many1___at_lean_parser_ident__univ__spec_parser_lean_parser_has__tokens___spec__1), 4, 1);
lean::closure_set(x_7, 0, x_6);
x_8 = lean::box(0);
x_9 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_9, 0, x_7);
lean::cnstr_set(x_9, 1, x_8);
x_4 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_4, 0, x_1);
x_5 = lean::mk_nat_obj(0u);
x_6 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_unicode__symbol_lean_parser_has__tokens___spec__1___boxed), 6, 3);
lean::closure_set(x_6, 0, x_1);
lean::closure_set(x_6, 1, x_5);
lean::closure_set(x_6, 2, x_4);
x_7 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_module_import__path_parser), 3, 0);
x_8 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_combinators_many1___at_lean_parser_ident__univ__spec_parser_lean_parser_has__tokens___spec__1), 4, 1);
lean::closure_set(x_8, 0, x_7);
x_9 = lean::box(0);
x_10 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_10, 0, x_5);
lean::cnstr_set(x_10, 0, x_8);
lean::cnstr_set(x_10, 1, x_9);
x_11 = l_lean_parser_basic__parser__m_monad;
x_12 = l_lean_parser_basic__parser__m_monad__except;
x_13 = l_lean_parser_basic__parser__m_lean_parser_monad__parsec;
x_14 = l_lean_parser_basic__parser__m_alternative;
x_15 = l_lean_parser_module_import;
x_16 = l_lean_parser_module_import_has__view;
x_17 = l_lean_parser_combinators_node_view___rarg(x_11, x_12, x_13, x_14, x_15, x_10, x_16);
lean::dec(x_10);
return x_17;
x_11 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_11, 0, x_6);
lean::cnstr_set(x_11, 1, x_10);
x_12 = l_lean_parser_basic__parser__m_monad;
x_13 = l_lean_parser_basic__parser__m_monad__except;
x_14 = l_lean_parser_basic__parser__m_lean_parser_monad__parsec;
x_15 = l_lean_parser_basic__parser__m_alternative;
x_16 = l_lean_parser_module_import;
x_17 = l_lean_parser_module_import_has__view;
x_18 = l_lean_parser_combinators_node_view___rarg(x_12, x_13, x_14, x_15, x_16, x_11, x_17);
lean::dec(x_11);
return x_18;
}
}
obj* _init_l_lean_parser_module_import_parser_lean_parser_has__tokens() {
_start:
{
obj* x_0; obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_8; obj* x_11;
obj* x_0; obj* x_1; obj* x_2; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_9; obj* x_12;
x_0 = lean::mk_string("import");
x_1 = lean::mk_nat_obj(0u);
x_2 = l_lean_parser_symbol_tokens___rarg(x_0, x_1);
x_3 = l_lean_parser_module_import__path_parser_lean_parser_has__tokens;
x_4 = l_lean_parser_tokens___rarg(x_3);
x_5 = lean::box(0);
x_6 = l_lean_parser_list_cons_tokens___rarg(x_4, x_5);
lean::dec(x_4);
x_8 = l_lean_parser_list_cons_tokens___rarg(x_2, x_6);
lean::dec(x_6);
lean::dec(x_0);
x_4 = l_lean_parser_module_import__path_parser_lean_parser_has__tokens;
x_5 = l_lean_parser_tokens___rarg(x_4);
x_6 = lean::box(0);
x_7 = l_lean_parser_list_cons_tokens___rarg(x_5, x_6);
lean::dec(x_5);
x_9 = l_lean_parser_list_cons_tokens___rarg(x_2, x_7);
lean::dec(x_7);
lean::dec(x_2);
x_11 = l_lean_parser_tokens___rarg(x_8);
lean::dec(x_8);
return x_11;
x_12 = l_lean_parser_tokens___rarg(x_9);
lean::dec(x_9);
return x_12;
}
}
obj* _init_l_lean_parser_module_import_parser___closed__1() {
_start:
{
obj* x_0; obj* x_1; obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10;
obj* x_0; obj* x_1; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11;
x_0 = lean::mk_string("import");
x_1 = l_string_trim(x_0);
lean::dec(x_0);
lean::inc(x_1);
x_3 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_3, 0, x_1);
x_4 = lean::mk_nat_obj(0u);
x_5 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_unicode__symbol_lean_parser_has__tokens___spec__1___boxed), 6, 3);
lean::closure_set(x_5, 0, x_1);
lean::closure_set(x_5, 1, x_4);
lean::closure_set(x_5, 2, x_3);
x_6 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_module_import__path_parser), 3, 0);
x_7 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_combinators_many1___at_lean_parser_ident__univ__spec_parser_lean_parser_has__tokens___spec__1), 4, 1);
lean::closure_set(x_7, 0, x_6);
x_8 = lean::box(0);
x_9 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_9, 0, x_7);
lean::cnstr_set(x_9, 1, x_8);
x_4 = lean::alloc_closure(reinterpret_cast<void*>(l_dlist_singleton___rarg), 2, 1);
lean::closure_set(x_4, 0, x_1);
x_5 = lean::mk_nat_obj(0u);
x_6 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol__core___at_lean_parser_unicode__symbol_lean_parser_has__tokens___spec__1___boxed), 6, 3);
lean::closure_set(x_6, 0, x_1);
lean::closure_set(x_6, 1, x_5);
lean::closure_set(x_6, 2, x_4);
x_7 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_module_import__path_parser), 3, 0);
x_8 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_combinators_many1___at_lean_parser_ident__univ__spec_parser_lean_parser_has__tokens___spec__1), 4, 1);
lean::closure_set(x_8, 0, x_7);
x_9 = lean::box(0);
x_10 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_10, 0, x_5);
lean::cnstr_set(x_10, 0, x_8);
lean::cnstr_set(x_10, 1, x_9);
return x_10;
x_11 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_11, 0, x_6);
lean::cnstr_set(x_11, 1, x_10);
return x_11;
}
}
obj* l_lean_parser_module_import_parser(obj* x_0, obj* x_1, obj* x_2) {

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -169,6 +169,7 @@ obj* l_lean_parser_string__lit_x_27___closed__1;
obj* l_lean_parser_symbol_view__default___boxed(obj*);
obj* l_lean_parser_detail__ident__suffix_has__view_x_27;
obj* l_lean_parser_monad__parsec_whitespace___at___private_init_lean_parser_token_2__whitespace__aux___main___spec__1(obj*, obj*, obj*);
obj* l_lean_parser_unicode__symbol___rarg___boxed(obj*, obj*, obj*, obj*);
obj* l_list_reverse___rarg(obj*);
obj* l_lean_parser_detail__ident__part_parser_lean_parser_has__view___lambda__1___boxed(obj*, obj*, obj*, obj*, obj*, obj*);
obj* l_lean_parser_monad__parsec_take__while__cont___at_lean_parser_detail__ident__part_parser___spec__4___boxed(obj*, obj*, obj*, obj*);
@ -427,6 +428,7 @@ obj* l_lean_parser_token__cont(obj*, obj*, obj*, obj*, obj*);
obj* l_lean_parser_parsec__t_lookahead___at_lean_parser_peek__token___spec__1(obj*, obj*, obj*);
obj* l_lean_parser_string__lit_has__view_x_27___lambda__2(obj*);
obj* l_lean_parser_monad__parsec_take__while___at_lean_parser_detail__ident__part_parser_lean_parser_has__view___spec__8(obj*);
obj* l_lean_parser_unicode__symbol_lean_parser_has__tokens___rarg___boxed(obj*, obj*, obj*);
obj* l_lean_parser_detail__ident_parser(obj*, obj*, obj*);
obj* l___private_init_lean_parser_parsec_4__take__while__aux___main___at___private_init_lean_parser_token_4__ident_x_27___spec__7(obj*, obj*, obj*);
obj* l_lean_parser_monad__parsec_take__while___at_lean_parser_detail__ident__part_parser___spec__8___rarg(obj*, obj*);
@ -715,6 +717,7 @@ obj* l_lean_parser_detail__ident__part_parser___closed__1;
obj* l_lean_parser_monad__parsec_take__while___at_lean_parser_detail__ident__part_parser_lean_parser_has__tokens___spec__27(obj*);
obj* l_lean_parser_number_x_27___lambda__3(obj*, obj*, obj*, obj*);
obj* l_lean_parser_monad__parsec_take__while__cont___at_lean_parser_parse__oct__lit___spec__2___boxed(obj*, obj*, obj*, obj*, obj*);
obj* l_lean_parser_symbol_tokens___rarg___boxed(obj*, obj*);
obj* l_lean_parser_detail__ident__part_parser_lean_parser_has__view;
obj* l_lean_parser_detail__ident__part_has__view_x_27___lambda__2___closed__2;
obj* l_lean_parser_parse__bin__lit(obj*, obj*, obj*);
@ -23325,6 +23328,7 @@ _start:
{
obj* x_3;
x_3 = l_lean_parser_symbol___rarg(x_0, x_1, x_2);
lean::dec(x_1);
lean::dec(x_2);
return x_3;
}
@ -23359,7 +23363,16 @@ obj* l_lean_parser_symbol_tokens(obj* x_0, obj* x_1) {
_start:
{
obj* x_2;
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol_tokens___rarg), 2, 0);
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_symbol_tokens___rarg___boxed), 2, 0);
return x_2;
}
}
obj* l_lean_parser_symbol_tokens___rarg___boxed(obj* x_0, obj* x_1) {
_start:
{
obj* x_2;
x_2 = l_lean_parser_symbol_tokens___rarg(x_0, x_1);
lean::dec(x_0);
return x_2;
}
}
@ -27057,7 +27070,7 @@ obj* l_lean_parser_unicode__symbol_lean_parser_has__tokens(obj* x_0, obj* x_1) {
_start:
{
obj* x_2;
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_unicode__symbol_lean_parser_has__tokens___rarg), 3, 0);
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_unicode__symbol_lean_parser_has__tokens___rarg___boxed), 3, 0);
return x_2;
}
}
@ -27070,6 +27083,16 @@ lean::dec(x_1);
return x_6;
}
}
obj* l_lean_parser_unicode__symbol_lean_parser_has__tokens___rarg___boxed(obj* x_0, obj* x_1, obj* x_2) {
_start:
{
obj* x_3;
x_3 = l_lean_parser_unicode__symbol_lean_parser_has__tokens___rarg(x_0, x_1, x_2);
lean::dec(x_0);
lean::dec(x_1);
return x_3;
}
}
obj* l_lean_parser_unicode__symbol_lean_parser_has__tokens___boxed(obj* x_0, obj* x_1) {
_start:
{
@ -27136,6 +27159,8 @@ _start:
obj* x_4;
x_4 = l_lean_parser_unicode__symbol_lean_parser_has__view___rarg(x_0, x_1, x_2, x_3);
lean::dec(x_0);
lean::dec(x_1);
lean::dec(x_2);
return x_4;
}
}
@ -27186,10 +27211,20 @@ obj* l_lean_parser_unicode__symbol(obj* x_0) {
_start:
{
obj* x_1;
x_1 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_unicode__symbol___rarg), 4, 0);
x_1 = lean::alloc_closure(reinterpret_cast<void*>(l_lean_parser_unicode__symbol___rarg___boxed), 4, 0);
return x_1;
}
}
obj* l_lean_parser_unicode__symbol___rarg___boxed(obj* x_0, obj* x_1, obj* x_2, obj* x_3) {
_start:
{
obj* x_4;
x_4 = l_lean_parser_unicode__symbol___rarg(x_0, x_1, x_2, x_3);
lean::dec(x_1);
lean::dec(x_2);
return x_4;
}
}
obj* l_lean_parser_unicode__symbol___boxed(obj* x_0) {
_start:
{

View file

@ -1619,6 +1619,46 @@ obj_res string_utf8_extract(b_obj_arg s, usize b, usize e) {
return r;
}
usize string_utf8_prev(b_obj_arg s, usize i) {
usize sz = string_size(s) - 1;
if (i == 0 || i > sz) return 0;
i--;
char const * str = string_cstr(s);
while (!is_utf8_first_byte(str[i])) {
lean_assert(i > 0);
i--;
}
return i;
}
static unsigned get_utf8_char_size_at(std::string const & s, usize i) {
if (auto sz = get_utf8_first_byte_opt(s[i])) {
return *sz;
} else {
return 1;
}
}
obj_res string_utf8_set(obj_arg s, usize i, uint32 c) {
usize sz = string_size(s) - 1;
if (i >= sz) return s;
char * str = w_string_cstr(s);
if (is_exclusive(s)) {
if (static_cast<unsigned char>(str[i]) < 128 && c < 128) {
str[i] = c;
return s;
}
}
if (!is_utf8_first_byte(str[i])) return s;
/* TODO(Leo): improve performance of other special cases.
Example: is_exclusive(s) and new and old characters have the same size; etc. */
std::string tmp;
push_unicode_scalar(tmp, c);
std::string new_s = string_to_std(s);
new_s.replace(i, get_utf8_char_size_at(new_s, i), tmp);
return mk_string(new_s);
}
/* `pos` is in bytes, and `remaining` is in characters */
static obj_res mk_iterator(obj_arg s, size_t pos, size_t remaining) {
obj_res r = alloc_cnstr(0, 1, sizeof(size_t)*2);
@ -1638,14 +1678,6 @@ static void it_set_remaining(u_obj_arg it, size_t r) { cnstr_set_scalar<size_t>(
static uint32 mk_default_char() { return 65; }
static bool is_unshared_it_string(b_obj_arg it) { return is_exclusive(it) && !is_shared(cnstr_get(it, 0)); }
static unsigned get_utf8_char_size_at(std::string const & s, unsigned i) {
if (auto sz = get_utf8_first_byte_opt(s[i])) {
return *sz;
} else {
return 1;
}
}
obj_res string_mk_iterator(obj_arg s) {
return mk_iterator(s, 0, string_len(s));
}

View file

@ -1166,6 +1166,8 @@ obj_res string_data(obj_arg s);
inline usize string_utf8_byte_size(b_obj_arg s) { return string_size(s) - 1; }
uint32 string_utf8_get(b_obj_arg s, usize i);
usize string_utf8_next(b_obj_arg s, usize i);
usize string_utf8_prev(b_obj_arg s, usize i);
obj_res string_utf8_set(obj_arg s, usize i, uint32 c);
inline uint8 string_utf8_at_end(b_obj_arg s, usize i) { return i >= string_size(s) - 1; }
obj_res string_utf8_extract(b_obj_arg s, usize b, usize e);
obj_res string_mk_iterator(obj_arg s);

View file

@ -9,12 +9,13 @@ def main : io uint32 :=
let s₁ := "hello α_world_β" in
let b := string.utf8_begin in
let e := s₁.utf8_byte_size in
io.println' (s₁.utf8_extract b e) *>
io.println' (s₁.utf8_extract (b+2) e) *>
io.println' (s₁.utf8_extract (b+2) (e-1)) *>
io.println' (s₁.utf8_extract (b+2) (e-2)) *>
io.println' (s₁.utf8_extract (b+7) e) *>
io.println' (s₁.utf8_extract (b+8) e) *>
io.println' (s₁.extract b e) *>
io.println' (s₁.extract (b+2) e) *>
io.println' (s₁.extract (b+2) (e-1)) *>
io.println' (s₁.extract (b+2) (e-2)) *>
io.println' (s₁.extract (b+7) e) *>
io.println' (s₁.extract (b+8) e) *>
io.println' (to_string e) *>
io.println' (repr " aaa ".trim) *>
show_chars s₁.utf8_byte_size.to_nat s₁ 0 *>
pure 0

View file

@ -5,6 +5,7 @@ llo α_world_
_world_β
17
"aaa"
>> h
>> e
>> l