Does WML support comment blocks?
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.
- TheBladeRoden
- Posts: 168
- Joined: July 16th, 2007, 8:01 am
Does WML support comment blocks?
The "putting a # before every single line" method can get tedious after all.
Founding Father of Columbia
Re: Does WML support comment blocks?
Code: Select all
#ifdef __UNUSED__
...
#endif
Re: Does WML support comment blocks?
I know some people used to put [comment][/comment] around a piece of WML to make it non-functional, because unrecognized tags were simply ignored.
However now it would probably trigger a warning about unrecognized WML.
However now it would probably trigger a warning about unrecognized WML.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Re: Does WML support comment blocks?
Setting an unused key shouldn't trigger any kind of warning, right?
You could also define a macro called COMMENT which does nothing, or even define _, and then you can write:
Code: Select all
comment="
This is a comment!
It spans multiple lines as you can see.
That's because it's really a string. But who cares!
"
Code: Select all
{_ "
This is another comment!
Just like the above.
"}
Wesnoth Bestiary ( PREVIEW IT HERE )
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Re: Does WML support comment blocks?
Using _ will causeancestral wrote:You could also define a macro called COMMENT which does nothing, or even define _
wmlxgettext
to see each macro substitution instance as a translatable string and waste translators’ time.
Example:
#ifdef
with an unlikely symbol, or just make it an actual block of commented-out lines. Some editors provide functions to do the latter in a much easier fashion, e.g. Kate (the “insert smart newline” action, Shift+Enter by default).Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.