Wasm-DSL / spectec

Wasm SpecTec specification tools
https://wasm-dsl.github.io/spectec/
Other
27 stars 9 forks source link

Add type indices #52

Closed rossberg closed 11 months ago

rossberg commented 11 months ago

This introduces parameters of the form

param ::=
  (varid ":") typ
  "syntax" synid
  "grammar" gramid ":" typ

that apply uniformly to syntax, grammar, and function definitions (refactoring the syntax of the latter). For now, they are all erased when lowering to the IL, except for value parameters on functions.

Also updates specs to use these in the definition of numeric types, values, and grammars.

Due to erasure, the IL remains unchanged for the time being, so this shouldn't affect most backends. The ones using the EL may need to adjust for the new function parameter AST, however. @f52985