[SOLVED] WML and Lua: Lua engine parsing too much?
Moderator: Forum Moderators
-
- Posts: 217
- Joined: December 17th, 2015, 10:27 pm
[SOLVED] WML and Lua: Lua engine parsing too much?
I'm not certain how to document this, report it as a glitch, or whether either of those should be done.
The lua engine seems to parse through any lines between a
And, of course, i got complaints of the 0x2D being unexpected and all that jazz.
The lua engine seems to parse through any lines between a
code=
and the [/lua]
. I know this because i had something like Code: Select all
[lua]
code=<<
local party = 'Do you love me?'
wesnoth.message(
'Big Brother' ,
party
)
>>
# local bad-name = 'junk'
[/lua]
Last edited by Can-ned_Food on November 12th, 2017, 4:10 am, edited 1 time in total.
-
- Inactive Developer
- Posts: 503
- Joined: April 24th, 2016, 4:18 pm
Re: WML and Lua: Lua engine parsing too much?
I forked real life and now I'm getting merge conflicts.
- Pentarctagon
- Project Manager
- Posts: 5565
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: WML and Lua: Lua engine parsing too much?
That code fragment causes no errors for me. I'm not sure what you were expecting it to do though - if the problem is it causes an error when that variable is uncommented, then that seems like it'd be expected, since you're declaring a lua variable outside of where lua code is understood.Can-ned_Food wrote:I'm not certain how to document this, report it as a glitch, or whether either of those should be done.
The lua engine seems to parse through any lines between acode=
and the[/lua]
. I know this because i had something likeAnd, of course, i got complaints of the 0x2D being unexpected and all that jazz.Code: Select all
[lua] code=<< local party = 'Do you love me?' wesnoth.message( 'Big Brother' , party ) >> # local bad-name = 'junk' [/lua]
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: WML and Lua: Lua engine parsing too much?
The Lua engine only runs the contents of the
code
attribute, by the way. The <<text here>>
syntax is part of the WML preprocessor (added specifically to enable writing embedded Lua) and it specifies that the string contained is to have any "
characters and all preprocessor directives in it ignored, including brace substitutions since braces are part of the Lua syntax. So if there really is a problem it’s not from the Lua engine.Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
-
- Posts: 217
- Joined: December 17th, 2015, 10:27 pm
Re: WML and Lua: Lua engine parsing too much?
Well, gee, it must've been a problem with the caching. I cannot delete this topic now that it has replies, but it should be deleted.