mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-25 03:04:13 +03:00
Add codegen support for records with visibilities
This commit is contained in:
parent
a6663db934
commit
f269a3c609
@ -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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user