Coding Conventions

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
fabi
Developer
Posts: 1223
Joined: March 21st, 2004, 2:42 pm
Location: Germany

Re: Coding Conventions

Post by fabi » May 9th, 2016, 7:40 pm

Celtic_Minstrel wrote:Underscores are perfectly valid in Lua table key identifiers.
Indeed. Whitespace is also valid. It just needs to be escaped.
"Wesnoth has many strong points but team and users management are certainly not in them." -- pyrophorus

User avatar
Celtic_Minstrel
Developer
Posts: 1532
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Coding Conventions

Post by Celtic_Minstrel » May 9th, 2016, 8:04 pm

No, whitespace is not valid in Lua table key identifiers. Underscores are.

The syntax {['a b c'] = 'xyz'} is not an escape syntax. It's a non-identifier table key.
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

fabi
Developer
Posts: 1223
Joined: March 21st, 2004, 2:42 pm
Location: Germany

Re: Coding Conventions

Post by fabi » May 9th, 2016, 8:12 pm

Yeah, I guess we get a bit off topic here.
"Wesnoth has many strong points but team and users management are certainly not in them." -- pyrophorus

Post Reply