diff --git a/document/core/text/values.rst b/document/core/text/values.rst index 918d35ab4e..1f4c1bbfdb 100644 --- a/document/core/text/values.rst +++ b/document/core/text/values.rst @@ -88,28 +88,26 @@ Floating-Point .. math:: \begin{array}{llclll@{\qquad\qquad}l} \production{decimal floating-point fraction} & \Tfrac &::=& - \epsilon &\Rightarrow& 0 \\ &&|& - d{:}\Tdigit~~q{:}\Tfrac &\Rightarrow& (d+q)/10 \\ &&|& - d{:}\Tdigit~~\text{\_}~~p{:}\Tdigit~~q{:}\Tfrac &\Rightarrow& (d+(p+q)/10)/10 \\ + d{:}\Tdigit &\Rightarrow& d/10 \\ &&|& + d{:}\Tdigit~~\text{\_}^?~~p{:}\Tfrac &\Rightarrow& (d+p/10)/10 \\ \production{hexadecimal floating-point fraction} & \Thexfrac &::=& - \epsilon &\Rightarrow& 0 \\ &&|& - h{:}\Thexdigit~~q{:}\Thexfrac &\Rightarrow& (h+q)/16 \\ &&|& - h{:}\Thexdigit~~\text{\_}~~~~p{:}\Thexdigit~~q{:}\Thexfrac &\Rightarrow& (h+(p+q)/16)/16 \\ + h{:}\Thexdigit &\Rightarrow& h/16 \\ &&|& + h{:}\Thexdigit~~\text{\_}^?~~p{:}\Thexfrac &\Rightarrow& (h+p/16)/16 \\ \production{decimal floating-point number} & \Tfloat &::=& - p{:}\Tnum + p{:}\Tnum~\text{.}^? &\Rightarrow& p \\ &&|& p{:}\Tnum~\text{.}~q{:}\Tfrac &\Rightarrow& p+q \\ &&|& - p{:}\Tnum~(\text{E}~|~\text{e})~{\pm}{:}\Tsign~e{:}\Tnum + p{:}\Tnum~\text{.}^?~(\text{E}~|~\text{e})~{\pm}{:}\Tsign~e{:}\Tnum &\Rightarrow& p\cdot 10^{\pm e} \\ &&|& p{:}\Tnum~\text{.}~q{:}\Tfrac~(\text{E}~|~\text{e})~{\pm}{:}\Tsign~e{:}\Tnum &\Rightarrow& (p+q)\cdot 10^{\pm e} \\ \production{hexadecimal floating-point number} & \Thexfloat &::=& - \text{0x}~p{:}\Thexnum + \text{0x}~p{:}\Thexnum~\text{.}^? &\Rightarrow& p \\ &&|& \text{0x}~p{:}\Thexnum~\text{.}~q{:}\Thexfrac &\Rightarrow& p+q \\ &&|& - \text{0x}~p{:}\Thexnum~(\text{P}~|~\text{p})~{\pm}{:}\Tsign~e{:}\Tnum + \text{0x}~p{:}\Thexnum~\text{.}^?~(\text{P}~|~\text{p})~{\pm}{:}\Tsign~e{:}\Tnum &\Rightarrow& p\cdot 2^{\pm e} \\ &&|& \text{0x}~p{:}\Thexnum~\text{.}~q{:}\Thexfrac~(\text{P}~|~\text{p})~{\pm}{:}\Tsign~e{:}\Tnum &\Rightarrow& (p+q)\cdot 2^{\pm e} diff --git a/test/core/const.wast b/test/core/const.wast index 6e8931a063..5656502987 100644 --- a/test/core/const.wast +++ b/test/core/const.wast @@ -154,6 +154,13 @@ (module (func (f64.const 0123456789.0123456789e019) drop)) (module (func (f64.const 0123456789.0123456789e+019) drop)) (module (func (f64.const 0123456789.0123456789e-019) drop)) +(module (func (f64.const 0_1_2_3_4_5_6_7_8_9) drop)) +(module (func (f64.const 0_1_2_3_4_5_6_7_8_9.) drop)) +(module (func (f64.const 0_1_2_3_4_5_6_7_8_9.0_1_2_3_4_5_6_7_8_9) drop)) +(module (func (f64.const 0_1_2_3_4_5_6_7_8_9e+0_1_9) drop)) +(module (func (f64.const 0_1_2_3_4_5_6_7_8_9.e+0_1_9) drop)) +(module (func (f64.const 0_1_2_3_4_5_6_7_8_9.0_1_2_3_4_5_6_7_8_9e0_1_9) drop)) + (module (func (f64.const 0x0123456789ABCDEFabcdef) drop)) (module (func (f64.const 0x0123456789ABCDEFabcdefp019) drop)) (module (func (f64.const 0x0123456789ABCDEFabcdefp+019) drop)) @@ -166,6 +173,14 @@ (module (func (f64.const 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp019) drop)) (module (func (f64.const 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp+019) drop)) (module (func (f64.const 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp-019) drop)) +(module (func (f64.const 0x0_1_2_3_4_5_6_7_8_9_A_B_C_D_E_F_a_b_c_d_e_f) drop)) +(module (func (f64.const 0x0_1_2_3_4_5_6_7_8_9_A_B_C_D_E_F_a_b_c_d_e_f.) drop)) +(module (func (f64.const 0x0_1_2_3_4_5_6_7_8_9_A_B_C_D_E_F_a_b_c_d_e_f.0_1_2_3_4_5_6_7_8_9_A_B_C_D_E_F_a_b_c_d_e_f) drop)) +(module (func (f64.const 0x0_1_2_3_4_5_6_7_8_9_A_B_C_D_E_F_a_b_c_d_e_fp0_1_9) drop)) +(module (func (f64.const 0x0_1_2_3_4_5_6_7_8_9_A_B_C_D_E_F_a_b_c_d_e_f.p0_1_9) drop)) +(module (func (f64.const 0x0_1_2_3_4_5_6_7_8_9_A_B_C_D_E_F_a_b_c_d_e_f.0_1_2_3_4_5_6_7_8_9_A_B_C_D_E_F_a_b_c_d_e_fp0_1_9) drop)) + + (assert_malformed (module quote "(func (f64.const) drop)") "unexpected token"