Coding Conventions

The place to post your WML questions and answers.

Moderator: Forum Moderators

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
Inactive Developer
Posts: 1260
Joined: March 21st, 2004, 2:42 pm
Location: Germany

Re: Coding Conventions

Post by fabi »

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: 2213
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Coding Conventions

Post by Celtic_Minstrel »

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.
Former maintainer of Steelhive.
fabi
Inactive Developer
Posts: 1260
Joined: March 21st, 2004, 2:42 pm
Location: Germany

Re: Coding Conventions

Post by fabi »

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