mirror of
https://github.com/CompeyDev/lune-packaging.git
synced 2025-01-09 12:19:09 +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,7 +83,12 @@ fn make_return_table_item(item: &DefinitionsItem) -> Result<String> {
|
|||
.map(|arg| format!("{}: {}", arg.name.trim(), arg.typedef.trim()))
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ");
|
||||
write!(contents, "function ({args})")?;
|
||||
// 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, "\n\treturn nil :: any")?;
|
||||
write!(contents, "\nend,")?;
|
||||
} else if item.is_property() {
|
||||
|
|
Loading…
Reference in a new issue