mirror of
https://github.com/CompeyDev/lune-packaging.git
synced 2025-01-10 04:39:08 +00:00
Fix syntax errors in generated typedef files
This commit is contained in:
parent
06051c0bbd
commit
93470b50af
1 changed files with 6 additions and 1 deletions
|
@ -83,6 +83,11 @@ fn make_return_table_item(item: &DefinitionsItem) -> Result<String> {
|
||||||
.map(|arg| format!("{}: {}", arg.name.trim(), arg.typedef.trim()))
|
.map(|arg| format!("{}: {}", arg.name.trim(), arg.typedef.trim()))
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.join(", ");
|
.join(", ");
|
||||||
|
// HACK: We should probably handle vararg and generics properly but this works for now...
|
||||||
|
let args = args
|
||||||
|
.replace("_: ...any", "...: any")
|
||||||
|
.replace("_: T...", "...: any")
|
||||||
|
.replace("(T...)", "(...any)");
|
||||||
write!(contents, "function({args})")?;
|
write!(contents, "function({args})")?;
|
||||||
write!(contents, "\n\treturn nil :: any")?;
|
write!(contents, "\n\treturn nil :: any")?;
|
||||||
write!(contents, "\nend,")?;
|
write!(contents, "\nend,")?;
|
||||||
|
|
Loading…
Reference in a new issue