Add codegen support for records with visibilities

This commit is contained in:
d0cd 2023-02-10 21:35:37 -08:00
parent a6663db934
commit f269a3c609

View File

@ -150,10 +150,15 @@ impl<'a> CodeGenerator<'a> {
// Construct and append the record variables.
for var in record.members.iter() {
let mode = match var.mode {
Mode::Constant => "constant",
Mode::Public => "public",
Mode::None | Mode::Private => "private",
};
writeln!(
output_string,
" {} as {}.private;", // todo: CAUTION private record variables only.
var.identifier, var.type_,
" {} as {}.{mode};", // todo: CAUTION private record variables only.
var.identifier, var.type_
)
.expect("failed to write to string");
}