Print field types

This commit is contained in:
a2x
2023-10-01 14:43:48 +10:00
parent 18e90bcf8c
commit 6d04af2758
73 changed files with 40045 additions and 39911 deletions

View File

@@ -22,14 +22,25 @@ impl FileBuilder for CppBuilder {
Ok(())
}
fn write_variable(&mut self, output: &mut dyn Write, name: &str, value: usize) -> Result<()> {
write!(
output,
" constexpr std::ptrdiff_t {} = {:#X};\n",
name, value
)?;
Ok(())
fn write_variable(
&mut self,
output: &mut dyn Write,
name: &str,
value: usize,
comment: Option<&str>,
) -> Result<()> {
match comment {
Some(comment) => write!(
output,
" constexpr std::ptrdiff_t {} = {:#X}; // {}\n",
name, value, comment
),
None => write!(
output,
" constexpr std::ptrdiff_t {} = {:#X};\n",
name, value
),
}
}
fn write_closure(&mut self, output: &mut dyn Write, eof: bool) -> Result<()> {