bug with wmlindent

Having trouble with the game? Report issues and get help here. Read this first!

Moderators: Forum Moderators, Developers

Forum rules
Before reporting issues in this section, you must read the following topic:

bug with wmlindent

Postby iceiceice » October 22nd, 2013, 7:02 am

Hi,

I tried to report this to http://bugs.wesnoth.org/, but it seems my gna registration email has been lost forever so perhaps that is an entirely separate bug ><

Edit: I registered a different account. Reported bug here.

I ran some of my (working, balanced) code on wmlindent and found a "end of file with nonzero indent" error, but when I cut it in half, both sides indented just fine. I removed as many balanced segments as I could until I got to a line-minimal counter example, then started removing characters. What I have here is not character minimal, but its about as small as is still intelligible.

I obtain the error from both 1.10 and 1.11 wmlindent versions, from wesnoth-1.10-tools, wesnoth-1.11-tools debian packages, the latter on rhonda.

Code: Select all
#define NO_STRING_HEADER
"#"
#enddef
[multiplayer]
    [event]
          {IF_VAR side_number equals 3 (
          )}
    [/event]
[/multiplayer]


The HEADER symbol originally corresponded to a pango formatting tag I was using.
Spoiler:


From here:

  • Running either wmlindent on the above code gives:
    Code: Select all
     wmlindent: "/home/chris/.local/share/wesnoth/1.10/data/add-ons/Rushed_By_Yetis/resources/graveyard/RBY_Interactive.cfg". line 9: end of file with indent nonzero.
  • Removing "{IF_VAR ... )}" alleviates the error.
  • Removing the # in line 2 alleviates the error.
  • Removing both quotes (leaving just #) in line 2 alleviates the error.
  • Getting closer to character minimal:

    Code: Select all
    "#"
    [multiplayer]
        [event]
              {(
              )}
        [/event]
    [/multiplayer]


    Is still bugged.
  • Removing the parenthesis () at this point alleviates the error.
  • Removing the carriage-return between the parenthesis alleviates the error.
  • Removing [event] and [/event] still leaves an error.

This bug mystifies me, because its easy to look at this and say "oh, for some reason wmlindent must want you to escape the # symbol, and then it isn't escaped so it interacts badly with whitespace in these parenthesis" or something, but then there's the fact if you remove [multiplayer] and [/multiplayer] above you don't have an error anymore, but if you remove [event] [/event] you do.

In conclusion, I don't know how wmlindent works, but I don't think it should be doing that.

My OS:
Code: Select all
chris@Basalt /usr/share/games/wesnoth/1.10/data/tools $ cat /etc/*release*
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=14
DISTRIB_CODENAME=nadia
DISTRIB_DESCRIPTION="Linux Mint 14 Nadia"
NAME="Ubuntu"
VERSION="12.10, Quantal Quetzal"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu quantal (12.10)"
VERSION_ID="12.10"


~iceiceice~
User avatar
iceiceice
Developer
 
Posts: 642
Joined: August 23rd, 2013, 2:10 am

Re: bug with wmlindent

Postby Groggy_Dice » October 23rd, 2013, 7:29 am

In fact, this bug has been dealt with in the dev branch, unfortunately a little too late to make it into the last 1.10 and 1.11 point releases. You can get the latest wmlindent straight from Github: https://raw.github.com/wesnoth/wesnoth- ... /wmlindent

If you'd like to read the commit message, the diff is here: https://github.com/wesnoth/wesnoth-old/ ... 2a2ccdb634
Ports:
Prudence (Josh Roby) | By the Sword (monochromatic) | The Eight of Cembulad (Lintana~ & WYRMY)
Resources:
UMC Timeline (Dec) | List of Unported UMC (Dec) | wmllint++ (Feb)
Groggy_Dice
Developer
 
Posts: 159
Joined: February 4th, 2011, 6:19 am

Re: bug with wmlindent

Postby iceiceice » October 23rd, 2013, 1:20 pm

Thanks!
User avatar
iceiceice
Developer
 
Posts: 642
Joined: August 23rd, 2013, 2:10 am


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests