Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wmllint cannot handle # inside single-line Lua code #8868

Open
sevu opened this issue May 13, 2024 · 2 comments
Open

wmllint cannot handle # inside single-line Lua code #8868

sevu opened this issue May 13, 2024 · 2 comments
Labels
Bug Issues involving unexpected behavior. WML Tools Issues involving WML maintenance tools.

Comments

@sevu
Copy link
Member

sevu commented May 13, 2024

Wmllint has has a problem with # in Lua code behind strong quotes:

[lua]
code=<<wml.variables.total_villages_on_map = #wesnoth.map.find{ gives_income = true }>>
[/lua]

tag stack nonempty ([('lua', {'code': '<<wml.variables.total_villages_on_map ='}, [])]) at end of file.

Moving the closing >> in a separate line is an alternative.

@sevu sevu added Bug Issues involving unexpected behavior. WML Tools Issues involving WML maintenance tools. labels May 13, 2024
@Wedge009 Wedge009 changed the title wmllint and # >> wmllint cannot handle # inside Lua code May 13, 2024
@Wedge009
Copy link
Member

Edited title just to (hopefully) give more clarity on first reading. Also wonder if this might tie in with #8385.

@Wedge009 Wedge009 changed the title wmllint cannot handle # inside Lua code wmllint cannot handle # inside single-line Lua code May 13, 2024
@sevu
Copy link
Member Author

sevu commented May 14, 2024

Thanks. To be concrete:
wmllint assumes the # starts a comment and ignores the rest of the line.
When using weak quotes ", it does however know that the # is inside quoted code.
(I used strong quotes because of the {} here.)

However, I cannot reproduce it with this example, so it might be Lua related:

[message]
	message=_ <<       You are #1 >>
[/message]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues involving unexpected behavior. WML Tools Issues involving WML maintenance tools.
Projects
None yet
Development

No branches or pull requests

2 participants