WebAssembly / simd

Branch of the spec repo scoped to discussion of SIMD in WebAssembly
Other
527 stars 43 forks source link

Small cleanup to num_pat to remove redundant Source.phrase #497

Closed ngzhian closed 3 years ago

ngzhian commented 3 years ago

Took the chance to clean up the matching logic for SimdResult too.

ngzhian commented 3 years ago

I think this wouldn't work upstream, because the [upstream definition]:(https://github.com/WebAssembly/spec/blob/master/interpreter/script/script.ml#L25)

type result = result' Source.phrase
and result' =
  | LitResult of literal
  | NanResult of nanop
  | RefResult of Types.ref_type

RefResult needs the Source.phrase outside.

This PR is more to clean up the kludge I introduced when changing result to include SimdResult.