Skip to content

Commit a119b24

Browse files
authored
[spec] Bring back explicit reftype in Element section (#2067)
1 parent ba77273 commit a119b24

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

specification/wasm-3.0/5.4-binary.modules.spectec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ grammar Belem : elem =
110110
ELEM (REF NULL FUNC) e* (ACTIVE 0 e_O)
111111
| 5:Bu32 rt:Breftype e*:Blist(Bexpr) =>
112112
ELEM rt e* PASSIVE
113-
| 6:Bu32 x:Btableidx e_O:Bexpr e*:Blist(Bexpr) =>
114-
ELEM (REF NULL FUNC) e* (ACTIVE x e_O)
113+
| 6:Bu32 x:Btableidx e_O:Bexpr rt:Breftype e*:Blist(Bexpr) =>
114+
ELEM rt e* (ACTIVE x e_O)
115115
| 7:Bu32 rt:Breftype e*:Blist(Bexpr) =>
116116
ELEM rt e* DECLARE
117117

spectec/test-frontend/TEST.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8818,7 +8818,7 @@ grammar Belem : elem
88188818
;; ../../../../specification/wasm-3.0/5.4-binary.modules.spectec
88198819
prod{rt : reftype, `e*` : expr*} {{`%`_u32(5):Bu32} {rt:Breftype} {e*{e <- `e*`}:Blist(syntax expr, grammar Bexpr)}} => ELEM_elem(rt, e*{e <- `e*`}, PASSIVE_elemmode)
88208820
;; ../../../../specification/wasm-3.0/5.4-binary.modules.spectec
8821-
prod{x : idx, e_O : expr, `e*` : expr*} {{`%`_u32(6):Bu32} {x:Btableidx} {e_O:Bexpr} {e*{e <- `e*`}:Blist(syntax expr, grammar Bexpr)}} => ELEM_elem(REF_reftype(?(NULL_null), FUNC_heaptype), e*{e <- `e*`}, ACTIVE_elemmode(x, e_O))
8821+
prod{x : idx, e_O : expr, rt : reftype, `e*` : expr*} {{`%`_u32(6):Bu32} {x:Btableidx} {e_O:Bexpr} {rt:Breftype} {e*{e <- `e*`}:Blist(syntax expr, grammar Bexpr)}} => ELEM_elem(rt, e*{e <- `e*`}, ACTIVE_elemmode(x, e_O))
88228822
;; ../../../../specification/wasm-3.0/5.4-binary.modules.spectec
88238823
prod{rt : reftype, `e*` : expr*} {{`%`_u32(7):Bu32} {rt:Breftype} {e*{e <- `e*`}:Blist(syntax expr, grammar Bexpr)}} => ELEM_elem(rt, e*{e <- `e*`}, DECLARE_elemmode)
88248824

spectec/test-latex/TEST.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12139,10 +12139,10 @@ $$
1213912139
\mathsf{elem}~{\mathit{rt}}~{e^\ast}~\mathsf{passive} \\
1214012140
\end{array}
1214112141
} \\
12142-
& & | & 6{:}{\mathtt{u32}}~~x{:}{\mathtt{tableidx}}~~e_{\mathsf{o}}{:}{\mathtt{expr}}~~{e^\ast}{:}{\mathtt{list}}({\mathtt{expr}}) & \quad\Rightarrow\quad{} & & \\
12142+
& & | & 6{:}{\mathtt{u32}}~~x{:}{\mathtt{tableidx}}~~e_{\mathsf{o}}{:}{\mathtt{expr}}~~{\mathit{rt}}{:}{\mathtt{reftype}}~~{e^\ast}{:}{\mathtt{list}}({\mathtt{expr}}) & \quad\Rightarrow\quad{} & & \\
1214312143
&&& \multicolumn{4}{@{}l@{}}{\quad
1214412144
\begin{array}[t]{@{}l@{}}
12145-
\mathsf{elem}~(\mathsf{ref}~\mathsf{null}~\mathsf{func})~{e^\ast}~(\mathsf{active}~x~e_{\mathsf{o}}) \\
12145+
\mathsf{elem}~{\mathit{rt}}~{e^\ast}~(\mathsf{active}~x~e_{\mathsf{o}}) \\
1214612146
\end{array}
1214712147
} \\
1214812148
& & | & 7{:}{\mathtt{u32}}~~{\mathit{rt}}{:}{\mathtt{reftype}}~~{e^\ast}{:}{\mathtt{list}}({\mathtt{expr}}) & \quad\Rightarrow\quad{} & & \\

spectec/test-middlend/TEST.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8808,7 +8808,7 @@ grammar Belem : elem
88088808
;; ../../../../specification/wasm-3.0/5.4-binary.modules.spectec
88098809
prod{rt : reftype, `e*` : expr*} {{`%`_u32(5):Bu32} {rt:Breftype} {e*{e <- `e*`}:Blist(syntax expr, grammar Bexpr)}} => ELEM_elem(rt, e*{e <- `e*`}, PASSIVE_elemmode)
88108810
;; ../../../../specification/wasm-3.0/5.4-binary.modules.spectec
8811-
prod{x : idx, e_O : expr, `e*` : expr*} {{`%`_u32(6):Bu32} {x:Btableidx} {e_O:Bexpr} {e*{e <- `e*`}:Blist(syntax expr, grammar Bexpr)}} => ELEM_elem(REF_reftype(?(NULL_null), FUNC_heaptype), e*{e <- `e*`}, ACTIVE_elemmode(x, e_O))
8811+
prod{x : idx, e_O : expr, rt : reftype, `e*` : expr*} {{`%`_u32(6):Bu32} {x:Btableidx} {e_O:Bexpr} {rt:Breftype} {e*{e <- `e*`}:Blist(syntax expr, grammar Bexpr)}} => ELEM_elem(rt, e*{e <- `e*`}, ACTIVE_elemmode(x, e_O))
88128812
;; ../../../../specification/wasm-3.0/5.4-binary.modules.spectec
88138813
prod{rt : reftype, `e*` : expr*} {{`%`_u32(7):Bu32} {rt:Breftype} {e*{e <- `e*`}:Blist(syntax expr, grammar Bexpr)}} => ELEM_elem(rt, e*{e <- `e*`}, DECLARE_elemmode)
88148814

@@ -20164,7 +20164,7 @@ grammar Belem : elem
2016420164
;; ../../../../specification/wasm-3.0/5.4-binary.modules.spectec
2016520165
prod{rt : reftype, `e*` : expr*} {{`%`_u32(5):Bu32} {rt:Breftype} {e*{e <- `e*`}:Blist(syntax expr, grammar Bexpr)}} => ELEM_elem(rt, e*{e <- `e*`}, PASSIVE_elemmode)
2016620166
;; ../../../../specification/wasm-3.0/5.4-binary.modules.spectec
20167-
prod{x : idx, e_O : expr, `e*` : expr*} {{`%`_u32(6):Bu32} {x:Btableidx} {e_O:Bexpr} {e*{e <- `e*`}:Blist(syntax expr, grammar Bexpr)}} => ELEM_elem(REF_reftype(?(NULL_null), FUNC_heaptype), e*{e <- `e*`}, ACTIVE_elemmode(x, e_O))
20167+
prod{x : idx, e_O : expr, rt : reftype, `e*` : expr*} {{`%`_u32(6):Bu32} {x:Btableidx} {e_O:Bexpr} {rt:Breftype} {e*{e <- `e*`}:Blist(syntax expr, grammar Bexpr)}} => ELEM_elem(rt, e*{e <- `e*`}, ACTIVE_elemmode(x, e_O))
2016820168
;; ../../../../specification/wasm-3.0/5.4-binary.modules.spectec
2016920169
prod{rt : reftype, `e*` : expr*} {{`%`_u32(7):Bu32} {rt:Breftype} {e*{e <- `e*`}:Blist(syntax expr, grammar Bexpr)}} => ELEM_elem(rt, e*{e <- `e*`}, DECLARE_elemmode)
2017020170

@@ -31699,7 +31699,7 @@ grammar Belem : elem
3169931699
;; ../../../../specification/wasm-3.0/5.4-binary.modules.spectec
3170031700
prod{rt : reftype, `e*` : expr*} {{`%`_u32(5):Bu32} {rt:Breftype} {e*{e <- `e*`}:Blist(syntax expr, grammar Bexpr)}} => ELEM_elem(rt, e*{e <- `e*`}, PASSIVE_elemmode)
3170131701
;; ../../../../specification/wasm-3.0/5.4-binary.modules.spectec
31702-
prod{x : idx, e_O : expr, `e*` : expr*} {{`%`_u32(6):Bu32} {x:Btableidx} {e_O:Bexpr} {e*{e <- `e*`}:Blist(syntax expr, grammar Bexpr)}} => ELEM_elem(REF_reftype(?(NULL_null), FUNC_heaptype), e*{e <- `e*`}, ACTIVE_elemmode(x, e_O))
31702+
prod{x : idx, e_O : expr, rt : reftype, `e*` : expr*} {{`%`_u32(6):Bu32} {x:Btableidx} {e_O:Bexpr} {rt:Breftype} {e*{e <- `e*`}:Blist(syntax expr, grammar Bexpr)}} => ELEM_elem(rt, e*{e <- `e*`}, ACTIVE_elemmode(x, e_O))
3170331703
;; ../../../../specification/wasm-3.0/5.4-binary.modules.spectec
3170431704
prod{rt : reftype, `e*` : expr*} {{`%`_u32(7):Bu32} {rt:Breftype} {e*{e <- `e*`}:Blist(syntax expr, grammar Bexpr)}} => ELEM_elem(rt, e*{e <- `e*`}, DECLARE_elemmode)
3170531705

0 commit comments

Comments
 (0)