[][src]Module zamm_yang::codegen

Code generation utilities.

This is roughly analogous to the MVC framework: Yin concepts are the model, templates are the view, and the planning modules are the controllers. This is perhaps not too surprising, because HTML is code too, webservers are code generators for the HTML language. Right now, we're merely rendering higher-level concepts in the form of Rust code instead of HTML code, and we're using the Rust compiler instead of the browser to render the generated code in a format that the end user finds useful.

Modules

filesystem

Actual changes to the filesystem.

planning

High-level planning for what the final generation configs will look like. All logic that touch Yin concepts in the codegen module should live inside of this sub-module.

template

Codegen templates.

track_autogen

Track autogenerated files.

Structs

CodegenConfig

Runtime options for code generation.

StructConfig

Config representing an imported struct.

Functions

add_fmt_skips

Add any relevant rustfmt skip markers for autogenerated code.

add_indent

Indent a line by a certain number of spaces.

count_indent

Returns the indent, as well as the first non-whitespace character.

output_code

Perform post-processing on generated code given the options specified in codegen_cfg, and then output it to the given destination file path.