inkeliz / karmem

Karmem is a fast binary serialization format, faster than Google Flatbuffers and optimized for TinyGo and WASM.
BSD 3-Clause "New" or "Revised" License
653 stars 27 forks source link

Support for Comments/Documentation #61

Open inkeliz opened 2 years ago

inkeliz commented 2 years ago

Currently, we don't support comments or documentation comment.

We should be able to add comments such as:

// Represents the foo struct
struct foo inline {
      // Represents the bar content
      bar []char;
}

Also, the code-generator should include some default comment, which can be disable:

// Bar is Foo field (your_document.km:2)
// Represents the foo struct
func (x *Foo) Bar() string {

}

The first comment is the default, which must follow the language convention. The second line is the user-defined comment, if the field contains one of them.