boschresearch/blech

struct declaration comments missing in generated files

frameworklabs opened this issue · 1 comments

Describe the bug
If a struct has declaration comments in a ".blc" file, the corresponding comments (both for the type and the members) are missing in the generated ".h" files.
Other declaration comments (external constants, functions, activities) seem to be generated fine.

To Reproduce
I am using blechc version: 0.6.1+0

Expected behaviour
Declaration comments for Blech structs in ".h" files.

This reveals a problem in the typed representation of a Blech program. Currently type declarations are handled different to other declarations - due to historical reasons.
This means: Annotations - here doc comments - are not stored in the typed AST. Therefore the code generation has no access to doc comments for user-defined types.

This requires a bigger refactoring in the type checker.
We will try to do this after the release of the module system on the master branch.