LuaGuiElement.select() uses a reserved keyword

Honktown
Smart Inserter
Smart Inserter
Posts: 1042
Joined: Thu Oct 03, 2019 7:10 am
Contact:

LuaGuiElement.select() uses a reserved keyword

Post by Honktown »

LuaGuiElement.select(start, end), in terms of Lua, creates an illegal identifier (end being a reserved keyword). Since it isn't actually constructed on the Lua side, this poses no issue at present in itself.

It's not that big of a deal, but for tools that may translate documentation into wrappers (e.g. the debugger), it requires a little tweaking to not break. Changing it subtly is enough to "fix" it. start_index + end_index, first + last, initial + final etc are just a few quick pairings that keep meaning but aren't illegal identifiers
I have mods! I guess!
Link
Honktown
Smart Inserter
Smart Inserter
Posts: 1042
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: LuaGuiElement.select() uses a reserved keyword

Post by Honktown »

Example, borrowed from someone else:
caution.png
caution.png (12.2 KiB) Viewed 694 times
I have mods! I guess!
Link
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: LuaGuiElement.select() uses a reserved keyword

Post by Bilka »

Thanks for noting this, the parameters have been renamed to start_index and end_index for the next version.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Resolved Requests”