boschresearch / blech

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

Allow doc comments for modules #61

Closed FriedrichGretz closed 3 years ago

FriedrichGretz commented 3 years ago

Is your feature request related to a problem? Please describe. A doc comment /** */ before a module declaration result in a syntax error.

Describe the solution you'd like The user might want to describe the module and also see this description in the generated C file.

Describe alternatives you've considered The comment may placed under the module declaration and is thereby attached to the first top level declaration of the module but this seems unnatural.

schorg commented 3 years ago

Should be possible, but not for imports - due to nasty shift-reduce conflicts.

schorg commented 3 years ago

Syntax changed. See commit 83591e462ef7ae01b3cf9fe3e0d3b79450511307.

Still todo: Store annotation in AST. Generate doc comment in signatures, .c and .h files.

schorg commented 3 years ago

Doc comments for modules are now stored in AST and typed AST. module (and signatures) only allow for doc comment annotations. This is checked during annotation checking. See commit 919dc835be1a80cbdf155e0268ada33b9cd7e068 Still todo: Generation of doc comments in signatures, .c and .h files.

schorg commented 3 years ago

Module doc comments are now generated to signature, .c-files and .h-files. See commit 63651fcaf4ebf34ed902f431166afdebed48c9da