boschresearch / blech

Blech is a language for developing reactive, real-time critical embedded software.
Apache License 2.0
72 stars 5 forks source link

struct declaration comments missing in generated files #59

Open frameworklabs opened 3 years ago

frameworklabs commented 3 years ago

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.

schorg commented 3 years ago

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.