@@ -930,21 +930,22 @@ function $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$Data(param0, p
930
930
this._1 = param1;
931
931
}
932
932
$64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$Data.prototype.$tag = 0;
933
- const $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$LastPos = { $tag: 1 };
934
- function $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$StartPos(param0) {
933
+ function $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$StartPosOf(param0) {
935
934
this._0 = param0;
936
935
}
937
- $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$StartPos .prototype.$tag = 2 ;
938
- function $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$EndPos (param0) {
936
+ $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$StartPosOf .prototype.$tag = 1 ;
937
+ function $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$EndPosOf (param0) {
939
938
this._0 = param0;
940
939
}
941
- $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$EndPos.prototype.$tag = 3;
942
- const $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$SymbolStartPos = { $tag: 4 };
940
+ $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$EndPosOf.prototype.$tag = 2;
941
+ const $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$StartPos = { $tag: 3 };
942
+ const $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$EndPos = { $tag: 4 };
943
+ const $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$SymbolStartPos = { $tag: 5 };
943
944
function $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$SubAction(param0, param1) {
944
945
this._0 = param0;
945
946
this._1 = param1;
946
947
}
947
- $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$SubAction.prototype.$tag = 5 ;
948
+ $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$SubAction.prototype.$tag = 6 ;
948
949
function $64$moonbitlang$47$yacc$47$lib$47$elab$46$TypeExpr$Constr(param0, param1, param2) {
949
950
this._0 = param0;
950
951
this._1 = param1;
@@ -17632,7 +17633,7 @@ function moonbitlang$yacc$lib$parser$$yy_action_11(_last_pos, _args) {
17632
17633
const _YYObj_String = _bind;
17633
17634
const _image = _YYObj_String._0;
17634
17635
const _start_pos = moonbitlang$core$array$$ArrayView$op_get$123$(_args, 0)._1;
17635
- const _end_pos = moonbitlang$core$array$$ArrayView$op_get$123$(_args, 0)._2;
17636
+ const _end_pos = moonbitlang$core$array$$ArrayView$op_get$123$(_args, moonbitlang$core$array$$ArrayView$length$123$(_args) - 1 | 0)._2;
17636
17637
return new Error$moonbitlang$47$yacc$47$lib$47$parser$46$YYObj__ast_Term$46$YYObj__ast_Term(new $64$moonbitlang$47$yacc$47$lib$47$ast$46$Term$Image(_image, { _0: _start_pos, _1: _end_pos }));
17637
17638
} else {
17638
17639
return $panic();
@@ -17691,7 +17692,7 @@ function moonbitlang$yacc$lib$parser$$yy_action_16(_last_pos, _args) {
17691
17692
const _YYObj__String__Int__Array__ast_SubstItem__ = _bind;
17692
17693
const _code = _YYObj__String__Int__Array__ast_SubstItem__._0;
17693
17694
const _start_pos = moonbitlang$core$array$$ArrayView$op_get$123$(_args, 0)._1;
17694
- const _end_pos = moonbitlang$core$array$$ArrayView$op_get$123$(_args, 0)._2;
17695
+ const _end_pos = moonbitlang$core$array$$ArrayView$op_get$123$(_args, moonbitlang$core$array$$ArrayView$length$123$(_args) - 1 | 0)._2;
17695
17696
const _code$2 = _code._0;
17696
17697
const _utf8_pos = _code._1;
17697
17698
const _subst = _code._2;
@@ -17871,7 +17872,7 @@ function moonbitlang$yacc$lib$parser$$yy_action_28(_last_pos, _args) {
17871
17872
const _YYObj__ast_PrecSymbol_ = _bind$2;
17872
17873
const _prec = _YYObj__ast_PrecSymbol_._0;
17873
17874
const _start_pos = moonbitlang$core$array$$ArrayView$op_get$123$(_args, 0)._1;
17874
- const _end_pos = moonbitlang$core$array$$ArrayView$op_get$123$(_args, 1 )._2;
17875
+ const _end_pos = moonbitlang$core$array$$ArrayView$op_get$123$(_args, moonbitlang$core$array$$ArrayView$length$123$(_args) - 1 | 0 )._2;
17875
17876
return new Error$moonbitlang$47$yacc$47$lib$47$parser$46$YYObj__ast_ClauseWithoutAction$46$YYObj__ast_ClauseWithoutAction({ items: moonbitlang$core$immut$list$$T$to_array$72$(_item_list), prec: _prec, loc: { _0: _start_pos, _1: _end_pos - _start_pos | 0 } });
17876
17877
} else {
17877
17878
return $panic();
@@ -17886,7 +17887,7 @@ function moonbitlang$yacc$lib$parser$$yy_action_29(_last_pos, _args) {
17886
17887
const _YYObj__ast_PrecSymbol_ = _bind;
17887
17888
const _prec = _YYObj__ast_PrecSymbol_._0;
17888
17889
const _start_pos = moonbitlang$core$array$$ArrayView$op_get$123$(_args, 0)._1;
17889
- const _end_pos = moonbitlang$core$array$$ArrayView$op_get$123$(_args, 0)._2;
17890
+ const _end_pos = moonbitlang$core$array$$ArrayView$op_get$123$(_args, moonbitlang$core$array$$ArrayView$length$123$(_args) - 1 | 0)._2;
17890
17891
return new Error$moonbitlang$47$yacc$47$lib$47$parser$46$YYObj__ast_ClauseWithoutAction$46$YYObj__ast_ClauseWithoutAction({ items: [], prec: _prec, loc: { _0: _start_pos, _1: _end_pos - _start_pos | 0 } });
17891
17892
} else {
17892
17893
return $panic();
@@ -18107,7 +18108,7 @@ function moonbitlang$yacc$lib$parser$$yy_action_46(_last_pos, _args) {
18107
18108
const _YYObj__ast_Symbol = _bind;
18108
18109
const _symbol = _YYObj__ast_Symbol._0;
18109
18110
const _start_pos = moonbitlang$core$array$$ArrayView$op_get$123$(_args, 0)._1;
18110
- const _end_pos = moonbitlang$core$array$$ArrayView$op_get$123$(_args, 0)._2;
18111
+ const _end_pos = moonbitlang$core$array$$ArrayView$op_get$123$(_args, moonbitlang$core$array$$ArrayView$length$123$(_args) - 1 | 0)._2;
18111
18112
return new Error$moonbitlang$47$yacc$47$lib$47$parser$46$YYObj__ast_Term$46$YYObj__ast_Term(new $64$moonbitlang$47$yacc$47$lib$47$ast$46$Term$Symbol(_symbol, { _0: _start_pos, _1: _end_pos }));
18112
18113
} else {
18113
18114
return $panic();
@@ -25408,9 +25409,8 @@ function moonbitlang$yacc$lib$elab$$elaborate_action$46$item_ident_to_index$248$
25408
25409
}
25409
25410
}
25410
25411
function moonbitlang$yacc$lib$elab$$elaborate_action$46$add_binding$249$(_env, desc) {
25411
- const items = _env._4;
25412
- const visited = _env._3;
25413
- const arity = _env._2;
25412
+ const items = _env._3;
25413
+ const visited = _env._2;
25414
25414
const bindings = _env._1;
25415
25415
const name_to_index = _env._0;
25416
25416
let _tmp = desc;
@@ -25427,40 +25427,30 @@ function moonbitlang$yacc$lib$elab$$elaborate_action$46$add_binding$249$(_env, d
25427
25427
return;
25428
25428
}
25429
25429
case 1: {
25430
- if (arity === 0) {
25431
- moonbitlang$core$array$$Array$push$17$(bindings, { _0: $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$LastPos, _1: "_start_pos" });
25432
- return;
25433
- } else {
25434
- moonbitlang$core$array$$Array$push$17$(bindings, { _0: new $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$StartPos(0), _1: "_start_pos" });
25435
- return;
25436
- }
25430
+ moonbitlang$core$array$$Array$push$17$(bindings, { _0: $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$StartPos, _1: "_start_pos" });
25431
+ return;
25437
25432
}
25438
25433
case 3: {
25439
25434
moonbitlang$yacc$lib$elab$$elaborate_action$46$add_binding$249$(_env, $64$moonbitlang$47$yacc$47$lib$47$ast$46$SubstItemDesc$StartPos);
25440
25435
_tmp = $64$moonbitlang$47$yacc$47$lib$47$ast$46$SubstItemDesc$EndPos;
25441
25436
continue _L;
25442
25437
}
25443
25438
case 2: {
25444
- if (arity === 0) {
25445
- moonbitlang$core$array$$Array$push$17$(bindings, { _0: $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$LastPos, _1: "_end_pos" });
25446
- return;
25447
- } else {
25448
- moonbitlang$core$array$$Array$push$17$(bindings, { _0: new $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$EndPos(arity - 1 | 0), _1: "_end_pos" });
25449
- return;
25450
- }
25439
+ moonbitlang$core$array$$Array$push$17$(bindings, { _0: $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$EndPos, _1: "_end_pos" });
25440
+ return;
25451
25441
}
25452
25442
case 4: {
25453
25443
const _StartPosOf = desc$2;
25454
25444
const _arg = _StartPosOf._0;
25455
25445
const index = moonbitlang$yacc$lib$elab$$elaborate_action$46$item_ident_to_index$248$(name_to_index, _arg);
25456
- moonbitlang$core$array$$Array$push$17$(bindings, { _0: new $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$StartPos (index), _1: `_start_pos_of_item${moonbitlang$core$builtin$$Show$to_string$13$(index)}` });
25446
+ moonbitlang$core$array$$Array$push$17$(bindings, { _0: new $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$StartPosOf (index), _1: `_start_pos_of_item${moonbitlang$core$builtin$$Show$to_string$13$(index)}` });
25457
25447
return;
25458
25448
}
25459
25449
case 5: {
25460
25450
const _EndPosOf = desc$2;
25461
25451
const _arg$2 = _EndPosOf._0;
25462
25452
const index$2 = moonbitlang$yacc$lib$elab$$elaborate_action$46$item_ident_to_index$248$(name_to_index, _arg$2);
25463
- moonbitlang$core$array$$Array$push$17$(bindings, { _0: new $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$EndPos (index$2), _1: `_end_pos_of_item${moonbitlang$core$builtin$$Show$to_string$13$(index$2)}` });
25453
+ moonbitlang$core$array$$Array$push$17$(bindings, { _0: new $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$EndPosOf (index$2), _1: `_end_pos_of_item${moonbitlang$core$builtin$$Show$to_string$13$(index$2)}` });
25464
25454
return;
25465
25455
}
25466
25456
case 6: {
@@ -25509,7 +25499,7 @@ function moonbitlang$yacc$lib$elab$$elaborate_action(items, ast_action, parser_s
25509
25499
}
25510
25500
const bindings = [];
25511
25501
const visited = moonbitlang$core$sorted_set$$new$44$();
25512
- const _env = { _0: name_to_index, _1: bindings, _2: arity, _3: visited, _4 : items };
25502
+ const _env = { _0: name_to_index, _1: bindings, _2: visited, _3 : items };
25513
25503
const body = [];
25514
25504
if (json_cst === 0) {
25515
25505
const _len$2 = items.length;
@@ -26607,21 +26597,21 @@ function moonbitlang$yacc$lib$desugar$$eliminate_inline_rules$46$cont$260$(_env,
26607
26597
}
26608
26598
break;
26609
26599
}
26610
- case 2 : {
26611
- const _StartPos = _subject;
26612
- const _data_index$2 = _StartPos ._0;
26600
+ case 1 : {
26601
+ const _StartPosOf = _subject;
26602
+ const _data_index$2 = _StartPosOf ._0;
26613
26603
if (_data_index$2 > start_index) {
26614
- new_subject = new $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$StartPos (_data_index$2 + index_shift | 0);
26604
+ new_subject = new $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$StartPosOf (_data_index$2 + index_shift | 0);
26615
26605
} else {
26616
26606
break _L$5;
26617
26607
}
26618
26608
break;
26619
26609
}
26620
- case 3 : {
26621
- const _EndPos = _subject;
26622
- const _data_index$3 = _EndPos ._0;
26610
+ case 2 : {
26611
+ const _EndPosOf = _subject;
26612
+ const _data_index$3 = _EndPosOf ._0;
26623
26613
if (_data_index$3 > start_index) {
26624
- new_subject = new $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$EndPos (_data_index$3 + index_shift | 0);
26614
+ new_subject = new $64$moonbitlang$47$yacc$47$lib$47$elab$46$BindingSubject$EndPosOf (_data_index$3 + index_shift | 0);
26625
26615
} else {
26626
26616
break _L$5;
26627
26617
}
@@ -28427,23 +28417,35 @@ function moonbitlang$yacc$lib$codegen$gen_mbt$$codegen(grammar, automaton, meta,
28427
28417
}
28428
28418
break;
28429
28419
}
28430
- case 1: {
28431
- moonbitlang$core$builtin$$Logger$write_string$247$(output, ` let ${moonbitlang$core$builtin$$Show$to_string$14$(binding._1)} = _last_pos\n`);
28420
+ case 3: {
28421
+ if (action.arity === 0) {
28422
+ moonbitlang$core$builtin$$Logger$write_string$247$(output, ` let ${moonbitlang$core$builtin$$Show$to_string$14$(binding._1)} = _last_pos\n`);
28423
+ } else {
28424
+ moonbitlang$core$builtin$$Logger$write_string$247$(output, ` let ${moonbitlang$core$builtin$$Show$to_string$14$(binding._1)} = _args[0].1\n`);
28425
+ }
28432
28426
break;
28433
28427
}
28434
- case 2: {
28435
- const _StartPos = _bind$4;
28436
- const _index$2 = _StartPos._0;
28428
+ case 4: {
28429
+ if (action.arity === 0) {
28430
+ moonbitlang$core$builtin$$Logger$write_string$247$(output, ` let ${moonbitlang$core$builtin$$Show$to_string$14$(binding._1)} = _last_pos\n`);
28431
+ } else {
28432
+ moonbitlang$core$builtin$$Logger$write_string$247$(output, ` let ${moonbitlang$core$builtin$$Show$to_string$14$(binding._1)} = _args[_args.length() - 1].2\n`);
28433
+ }
28434
+ break;
28435
+ }
28436
+ case 1: {
28437
+ const _StartPosOf = _bind$4;
28438
+ const _index$2 = _StartPosOf._0;
28437
28439
index = _index$2;
28438
28440
break _L$2;
28439
28441
}
28440
- case 3 : {
28441
- const _EndPos = _bind$4;
28442
- const _index$3 = _EndPos ._0;
28442
+ case 2 : {
28443
+ const _EndPosOf = _bind$4;
28444
+ const _index$3 = _EndPosOf ._0;
28443
28445
index = _index$3;
28444
28446
break _L$2;
28445
28447
}
28446
- case 4 : {
28448
+ case 5 : {
28447
28449
moonbitlang$core$sorted_set$$T$add$14$(used_runtime_funcs, "_get_symbol_start_pos");
28448
28450
moonbitlang$core$builtin$$Logger$write_string$247$(output, ` let ${moonbitlang$core$builtin$$Show$to_string$14$(binding._1)} = _get_symbol_start_pos(_args, _last_pos)\n`);
28449
28451
break;
@@ -28489,11 +28491,11 @@ function moonbitlang$yacc$lib$codegen$gen_mbt$$codegen(grammar, automaton, meta,
28489
28491
const _bind$4 = binding._0;
28490
28492
let field;
28491
28493
switch (_bind$4.$tag) {
28492
- case 2 : {
28494
+ case 1 : {
28493
28495
field = 1;
28494
28496
break;
28495
28497
}
28496
- case 3 : {
28498
+ case 2 : {
28497
28499
field = 2;
28498
28500
break;
28499
28501
}
0 commit comments