Add indentation to Luau output
This commit is contained in:
@@ -105,9 +105,9 @@ impl Target for Luau {
|
||||
};
|
||||
let data = Module::from_data(&bytes);
|
||||
|
||||
write!(w, "assert_trap((function() ")?;
|
||||
writeln!(w, "assert_trap((function()")?;
|
||||
codegen_luau::from_module_untyped(&data, w)?;
|
||||
writeln!(w, " end)(), linked)")
|
||||
writeln!(w, "end)(), linked)")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -154,10 +154,10 @@ impl Target for Luau {
|
||||
let numeric = codegen_luau::NUMERIC;
|
||||
|
||||
writeln!(w, "local Integer = (function()")?;
|
||||
writeln!(w, "{numeric}")?;
|
||||
write!(w, "{numeric}")?;
|
||||
writeln!(w, "end)()")?;
|
||||
writeln!(w, "local rt = (function()")?;
|
||||
writeln!(w, "{runtime}")?;
|
||||
write!(w, "{runtime}")?;
|
||||
writeln!(w, "end)()")?;
|
||||
|
||||
writeln!(w, "{ASSERTION}")
|
||||
@@ -166,7 +166,7 @@ impl Target for Luau {
|
||||
fn write_module(data: &Module, name: Option<&str>, w: &mut dyn Write) -> Result<()> {
|
||||
let type_info = TypeInfo::from_module(data);
|
||||
|
||||
write!(w, r#"loaded["temp"] = (function() "#)?;
|
||||
writeln!(w, r#"loaded["temp"] = (function()"#)?;
|
||||
codegen_luau::from_module_typed(data, &type_info, w)?;
|
||||
writeln!(w, "end)()(linked)")?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user