-
Notifications
You must be signed in to change notification settings - Fork 5
Description
How about considering the share keyword coming before (func ...) without parens? Like this:
(type $shared shared (func))
In this syntax, we don't need to change how to parse (func) and the syntax tree.
For instance, currently in wasm-language-tools, the syntax kind of (func) is FUNC_TYPE and it's one of the children of the type definition syntax. But for (type (shared (func))), the (func) part won't be the direct child of type definition any more; instead, it will become an indirect descendant of type definition, which causes a huge breaking change to analysises in language server.
Another advantage of the syntax I proposed is, the share keyword will look like a "modifier" of comptype, instead of something like additional attributes of comptype. Because, comptype itself shouldn't concern whether it's shared or not, I think.
Also, in memtype syntax (from "Threads" proposal), it's also just a single word without parens and something else.