@@ -211,25 +211,25 @@ global_type :
211211 | VALUE_TYPE { GlobalType ($ 1 , Immutable ) }
212212 | LPAR MUT VALUE_TYPE RPAR { GlobalType ($ 3 , Mutable ) }
213213
214- func_type :
215- | LPAR FUNC func_sig RPAR { $ 3 }
214+ def_type :
215+ | LPAR FUNC func_type RPAR { $ 3 }
216216
217- func_sig :
217+ func_type :
218218 | /* empty */
219219 { FuncType ([] , [] ) }
220- | LPAR RESULT value_type_list RPAR func_sig
220+ | LPAR RESULT value_type_list RPAR func_type
221221 { let FuncType (ins, out) = $ 5 in
222222 if ins <> [] then error (at () ) " result before parameter" ;
223223 FuncType (ins, $ 3 @ out) }
224- | LPAR PARAM value_type_list RPAR func_sig
224+ | LPAR PARAM value_type_list RPAR func_type
225225 { let FuncType (ins, out) = $ 5 in FuncType ($ 3 @ ins, out) }
226- | LPAR PARAM bind_var VALUE_TYPE RPAR func_sig /* Sugar */
226+ | LPAR PARAM bind_var VALUE_TYPE RPAR func_type /* Sugar */
227227 { let FuncType (ins, out) = $ 6 in FuncType ($ 4 :: ins, out) }
228228
229- table_sig :
229+ table_type :
230230 | limits elem_type { TableType ($ 1 , $ 2 ) }
231231
232- memory_sig :
232+ memory_type :
233233 | limits { MemoryType $ 1 }
234234
235235limits :
@@ -327,11 +327,11 @@ plain_instr :
327327 | CONVERT { fun c -> $1 }
328328
329329call_instr :
330- | CALL_INDIRECT call_instr_sig
330+ | CALL_INDIRECT call_instr_type
331331 { let at1 = ati 1 in
332332 fun c -> let x, es = $ 2 c in call_indirect x @@ at1, es }
333333
334- call_instr_sig :
334+ call_instr_type :
335335 | type_use call_instr_params
336336 { let at1 = ati 1 in
337337 fun c ->
@@ -366,11 +366,11 @@ block_instr :
366366 { fun c -> let c' = $ 2 c ($ 5 @ $ 8 ) in
367367 let ts, es1 = $ 3 c' in if_ ts es1 ($ 6 c') }
368368
369- block_sig :
369+ block_type :
370370 | LPAR RESULT VALUE_TYPE RPAR { [$ 3 ] }
371371
372372block :
373- | block_sig instr_list
373+ | block_type instr_list
374374 { fun c -> $ 1 , $ 2 c }
375375 | instr_list { fun c -> [], $1 c }
376376
@@ -380,7 +380,7 @@ expr : /* Sugar */
380380
381381expr1 : /* Sugar */
382382 | plain_instr expr_list { fun c -> $2 c, $1 c }
383- | CALL_INDIRECT call_expr_sig
383+ | CALL_INDIRECT call_expr_type
384384 { fun c -> let x, es = $ 2 c in es, call_indirect x }
385385 | BLOCK labeling_opt block
386386 { fun c -> let c' = $ 2 c [] in let ts, es = $ 3 c' in [] , block ts es }
@@ -390,7 +390,7 @@ expr1 : /* Sugar */
390390 { fun c -> let c' = $ 2 c [] in
391391 let ts, (es, es1, es2) = $ 3 c c' in es, if_ ts es1 es2 }
392392
393- call_expr_sig :
393+ call_expr_type :
394394 | type_use call_expr_params
395395 { let at1 = ati 1 in
396396 fun c ->
@@ -416,7 +416,7 @@ call_expr_results :
416416
417417
418418if_block :
419- | block_sig if_block { fun c c' -> let ts, ess = $ 2 c c' in $ 1 @ ts , ess }
419+ | block_type if_block { fun c c' -> let ts, ess = $ 2 c c' in $ 1 @ ts , ess }
420420 | if_ { fun c c' -> [], $1 c c' }
421421
422422if_ :
@@ -534,9 +534,9 @@ table :
534534 fun () -> $ 4 c x at }
535535
536536table_fields :
537- | table_sig
537+ | table_type
538538 { fun c x at -> [{ttype = $ 1 } @@ at], [] , [] , [] }
539- | inline_import table_sig
539+ | inline_import table_type /* Sugar */
540540 { fun c x at ->
541541 [] , [] ,
542542 [{ module_name = fst $ 1 ; item_name = snd $ 1 ;
@@ -566,9 +566,9 @@ memory :
566566 fun () -> $ 4 c x at }
567567
568568memory_fields :
569- | memory_sig
569+ | memory_type
570570 { fun c x at -> [{mtype = $ 1 } @@ at], [] , [] , [] }
571- | inline_import memory_sig
571+ | inline_import memory_type /* Sugar */
572572 { fun c x at ->
573573 [] , [] ,
574574 [{ module_name = fst $ 1 ; item_name = snd $ 1 ;
@@ -593,7 +593,7 @@ global :
593593global_fields :
594594 | global_type const_expr
595595 { fun c x at -> [{gtype = $ 1 ; value = $ 2 c} @@ at], [] , [] }
596- | inline_import global_type
596+ | inline_import global_type /* Sugar */
597597 { fun c x at ->
598598 [] ,
599599 [{ module_name = fst $ 1 ; item_name = snd $ 1 ;
@@ -609,14 +609,14 @@ import_desc :
609609 | LPAR FUNC bind_var_opt type_use RPAR
610610 { fun c -> ignore ($ 3 c anon_func bind_func);
611611 fun () -> FuncImport ($ 4 c type_) }
612- | LPAR FUNC bind_var_opt func_sig RPAR /* Sugar */
612+ | LPAR FUNC bind_var_opt func_type RPAR /* Sugar */
613613 { let at4 = ati 4 in
614614 fun c -> ignore ($ 3 c anon_func bind_func);
615615 fun () -> FuncImport (inline_type c $ 4 at4) }
616- | LPAR TABLE bind_var_opt table_sig RPAR
616+ | LPAR TABLE bind_var_opt table_type RPAR
617617 { fun c -> ignore ($ 3 c anon_table bind_table);
618618 fun () -> TableImport $ 4 }
619- | LPAR MEMORY bind_var_opt memory_sig RPAR
619+ | LPAR MEMORY bind_var_opt memory_type RPAR
620620 { fun c -> ignore ($ 3 c anon_memory bind_memory);
621621 fun () -> MemoryImport $ 4 }
622622 | LPAR GLOBAL bind_var_opt global_type RPAR
@@ -651,7 +651,7 @@ inline_export :
651651/* Modules */
652652
653653type_ :
654- | func_type { $ 1 @@ at () }
654+ | def_type { $ 1 @@ at () }
655655
656656type_def :
657657 | LPAR TYPE type_ RPAR
0 commit comments