# t.def
page: t, basic_frame
module: c
a=10
b=a
$dump a, b
$ mydef_run t.def
PAGE: t
--> [./t.c]
gcc -std=c99 -O2 -o./t ./t.c && ./t
:a=10, b=10
I didn't introduce `known` keyword. If I want straight C code passthrough I simply append semicolons.MyDef is a general preprocessor, so I need the page and module declarations to tell what file and types I am generating. It always shows the command it actually runs, so there is no magic. And it does not pretend to replace C. It always produces `.c` file for debugging or merging with existing workflow.
As long as MyDef is strictly preprocessor, it is purely complementary. If you prefer straight C/C++ at places, just use straight C. If you have questions on what MyDef syntax does, just read the C output.
It does pose some restrictions on the C I write. I do not write long statements in multiple lines and rely on my editor to softwrap the lines. Long lines are difficult to read anyway with or without splitting and soft-wrapped lines are not much difficult to read anyway. I often can avoid long lines by refactoring. In rare cases that lines still end up too long, I leave it as is to remind me that it needs further work.
Sometimes I need import third-party raw c code during a progress of refactoring or code digesting. MyDef has template construct to quote them directly.
MyDef: https://github.com/hzhou/MyDef output_c: https://github.com/hzhou/output_c