mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Add nullable syntax support for LuaLS meta script
Co-authored-by: Nerixyz <nerixdev@outlook.de>
This commit is contained in:
parent
ad4a0db6c3
commit
a0b434309a
|
@ -196,7 +196,7 @@ def write_func(path: Path, line: int, comments: list[str], out: TextIOWrapper):
|
|||
if not comments[0].startswith("@"):
|
||||
out.write(f"--- {comments[0]}\n---\n")
|
||||
comments = comments[1:]
|
||||
params = []
|
||||
params: list[str] = []
|
||||
for comment in comments[:-1]:
|
||||
if not comment.startswith("@lua"):
|
||||
panic(path, line, f"Invalid function specification - got '{comment}'")
|
||||
|
@ -209,7 +209,7 @@ def write_func(path: Path, line: int, comments: list[str], out: TextIOWrapper):
|
|||
panic(path, line, f"Invalid function exposure - got '{comments[-1]}'")
|
||||
name = comments[-1].split(" ", 1)[1]
|
||||
printmsg(path, line, f"function {name}")
|
||||
lua_params = ", ".join(params)
|
||||
lua_params = ", ".join(p.removesuffix("?") for p in params)
|
||||
out.write(f"function {name}({lua_params}) end\n\n")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue