semicolons in names (valid?)
semicolons in names (valid?)
I ran into a "bug" where I assumed semicolons weren't valid in names/identifiers (just word characters, hyphens, underscores, the lua definition of things). Figured I would ask here, if anyone knew whether or not semicolons were supposed to be "valid" in names/categories/etc; if there were any solid definition anywhere.
I have mods! I guess!
Link
Link
Re: semicolons in names (valid?)
https://www.lua.org/pil/1.1.html
A semicolon may optionally follow any statement. Usually, I use semicolons only to separate two or more statements written in the same line, but this is just a convention. Line breaks play no role in Lua's syntax; for instance, the following four chunks are all valid and equivalent:
a = 1
b = a*2
a = 1;
b = a*2;
a = 1 ; b = a*2
a = 1 b = a*2 -- ugly, but valid
Re: semicolons in names (valid?)
I can look up how lua handles things, but Factorio will handle things its own way. I'm hoping there's a Factorio reference and not "if it works it's valid"
I have mods! I guess!
Link
Link
Re: semicolons in names (valid?)
Strings dont matter.
Semicolons and practically anything can be used as a prototype name.
Semicolons and practically anything can be used as a prototype name.
Re: semicolons in names (valid?)
Those are the only restrictions given by Factorio.https://wiki.factorio.com/PrototypeBase#name wrote: May not contain ., may not exceed a length of 200 characters.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: semicolons in names (valid?)
Now i wonder, is that 200 characters or 200 bytes? Some languages have multi-byte characters ;)Bilka wrote: Thu Nov 28, 2019 7:36 amThose are the only restrictions given by Factorio.https://wiki.factorio.com/PrototypeBase#name wrote: May not contain ., may not exceed a length of 200 characters.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: semicolons in names (valid?)
You. Cut that shit out. I had to rewrite a function because I needed to empty a table and instead assigned the local variable to the empty table. It's bad enough using pairs() over a table you're modifying is undefined behavior.eradicator wrote: Thu Nov 28, 2019 7:14 pmNow i wonder, is that 200 characters or 200 bytes? Some languages have multi-byte charactersBilka wrote: Thu Nov 28, 2019 7:36 amThose are the only restrictions given by Factorio.https://wiki.factorio.com/PrototypeBase#name wrote: May not contain ., may not exceed a length of 200 characters.
I have mods! I guess!
Link
Link
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: semicolons in names (valid?)
I have no fucking clue what you're talking about. But please calm down.Honktown wrote: Thu Nov 28, 2019 9:03 pmYou. Cut that shit out. I had to rewrite a function because I needed to empty a table and instead assigned the local variable to the empty table. It's bad enough using pairs() over a table you're modifying is undefined behavior.eradicator wrote: Thu Nov 28, 2019 7:14 pmNow i wonder, is that 200 characters or 200 bytes? Some languages have multi-byte characters ;)Bilka wrote: Thu Nov 28, 2019 7:36 amThose are the only restrictions given by Factorio.https://wiki.factorio.com/PrototypeBase#name wrote: May not contain ., may not exceed a length of 200 characters.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: semicolons in names (valid?)
You probably mean grapheme clusters.eradicator wrote: Thu Nov 28, 2019 7:14 pm Now i wonder, is that 200 characters or 200 bytes? Some languages have multi-byte characters
Who would care about single code points anyway...