Skip to content

Commit 933d2dd

Browse files
committed
[interpreter] Tweak parser
1 parent 083f24c commit 933d2dd

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

interpreter/text/parser.mly

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -732,11 +732,11 @@ elem_expr_list :
732732
elem_var_list :
733733
| var_list
734734
{ let f = function {at; _} as x -> [ref_func x @@ at] @@ at in
735-
fun c lookup -> List.map f ($1 c lookup) }
735+
fun c -> List.map f ($1 c func) }
736736

737737
elem_list :
738738
| elem_kind elem_var_list
739-
{ ($1, fun c -> $2 c func) }
739+
{ ($1, fun c -> $2 c) }
740740
| ref_type elem_expr_list
741741
{ ($1, fun c -> $2 c) }
742742

@@ -768,7 +768,7 @@ elem :
768768
{ let at = at () in
769769
fun c -> ignore ($3 c anon_elem bind_elem);
770770
fun () ->
771-
{ etype = FuncRefType; einit = $5 c func;
771+
{ etype = FuncRefType; einit = $5 c;
772772
emode = Active {index = 0l @@ at; offset = $4 c} @@ at } @@ at }
773773

774774
table :
@@ -788,19 +788,19 @@ table_fields :
788788
| inline_export table_fields /* Sugar */
789789
{ fun c x at -> let tabs, elems, ims, exs = $2 c x at in
790790
tabs, elems, ims, $1 (TableExport x) c :: exs }
791-
| ref_type LPAR ELEM elem_var_list RPAR /* Sugar */
791+
| ref_type LPAR ELEM elem_expr elem_expr_list RPAR /* Sugar */
792792
{ fun c x at ->
793793
let offset = [i32_const (0l @@ at) @@ at] @@ at in
794-
let einit = $4 c func in
794+
let einit = $4 c :: $5 c in
795795
let size = Lib.List32.length einit in
796796
let emode = Active {index = x; offset} @@ at in
797797
[{ttype = TableType ({min = size; max = Some size}, $1)} @@ at],
798-
[{etype = FuncRefType; einit; emode} @@ at],
798+
[{etype = $1; einit; emode} @@ at],
799799
[], [] }
800-
| ref_type LPAR ELEM elem_expr elem_expr_list RPAR /* Sugar */
800+
| ref_type LPAR ELEM elem_var_list RPAR /* Sugar */
801801
{ fun c x at ->
802802
let offset = [i32_const (0l @@ at) @@ at] @@ at in
803-
let einit = (fun c -> $4 c :: $5 c) c in
803+
let einit = $4 c in
804804
let size = Lib.List32.length einit in
805805
let emode = Active {index = x; offset} @@ at in
806806
[{ttype = TableType ({min = size; max = Some size}, $1)} @@ at],

0 commit comments

Comments
 (0)