WebAssembly / component-model

Repository for design and specification of the Component Model
Other
971 stars 81 forks source link

format: EBNF Syntax Highlighting, comments as whitespace, relax some reserved keywords #156

Closed huwaireb closed 1 year ago

huwaireb commented 1 year ago

154

Question:

  1. Should doc-comments also be treated as white-space? As they can be accessed from the CST

Minor Note: I replaced the EBNF grammar block's language from WIT -> EBNF, as github supports EBNF for syntax highlighting

tschneidereit commented 1 year ago

In the early days of the wit format, we talked about ensuring that doc comments could be properly translated into the right format for all languages we'd want to generate bindings for, including the right structure for parameter documentation, examples, etc. Doing that would require us to not treat comments as whitespace, and instead add their internal structure to the grammar, I think.

huwaireb commented 1 year ago

@tschneidereit I fully understand, I looked over how wit-bindgen and the wit-related projects by bytecodalliance function to get a better understanding

This is why I left only comments as white-space and kept doc-comments (there's two non-terminals, doc-comments being separated from comments).

However, as doc-comments can still be accessed from the CST, I'm leaving adding the doc-comments nonterminal to whitespace up to others.

lukewagner commented 1 year ago

This looks mergable to me. @tschneidereit, did @r-muhairi's reply make sense to you?

huwaireb commented 1 year ago

@lukewagner I've rebased the PR, as long as everything is okay this should be fine.

lukewagner commented 1 year ago

Oops, sorry for letting this drop. Thanks for the rebase and reminder!