[WML] multi line comments

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
200g
Posts: 13
Joined: April 2nd, 2008, 1:08 pm
Location: Bad Segeberg, Germany
Contact:

[WML] multi line comments

Post by 200g »

Hi,
I can't believe that you devs did not include a multi line comment in WML since a good (the only?) way to debug WML is to cut out lots and lots of code. Just to make this clear for everybody; multi line comments could look like this:

Code: Select all

/* commented
still commented
see above */
I tried to figure out why something like this is not implemented yet and came up with the following possible reasons:

1. You hate multi line comments
2. It's difficult to implement and brings no fame
3. You never ever thought about that (very unlikely)
4. There ARE multi line comments! (if true, i deeply apologize for creating traffic)

If the real reason does not match with one from my list (except number three) and one of you has some time to waste, would you (please) implement these comments?
Great!

Thanks in advance,
200g
Last edited by 200g on April 13th, 2008, 11:16 pm, edited 1 time in total.
If you open your mind too much, your brain will fall out.
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Re: /* [WML] multi line comments */

Post by Noyga »

Well AFAIK there is already the possibility to put anything in a dummy tag...
For example something like this :

Code: Select all

[comment]
   blah
   foobar
[/comment]
It's not totally perfect, through
"Ooh, man, my mage had a 30% chance to miss, but he still managed to hit! Awesome!" ;) -- xtifr
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: /* [WML] multi line comments */

Post by AI »

or you could use the preprocessor:

#ifdef __UNUSED__
code that doesn't work
comments or something
whatever
#endif
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Re: /* [WML] multi line comments */

Post by Noyga »

Ha yes this is even better :)
"Ooh, man, my mage had a 30% chance to miss, but he still managed to hit! Awesome!" ;) -- xtifr
200g
Posts: 13
Joined: April 2nd, 2008, 1:08 pm
Location: Bad Segeberg, Germany
Contact:

Re: /* [WML] multi line comments */

Post by 200g »

It's hard getting used to the hackish way of WML... so please forgive me that I did not think of #define-comments. It's just... dir(rr)ty. And tags that aren't recognized will not even cause an error or at least a warning? That's too KISSy for my taste ;)

Thanks for your answers.
If you open your mind too much, your brain will fall out.
User avatar
irrevenant
Moderator Emeritus
Posts: 3692
Joined: August 15th, 2005, 7:57 am
Location: I'm all around you.

Re: [WML] multi line comments

Post by irrevenant »

(1) Inbuilt multi-line comments seems like a good suggestion.
(2) You made that suggestion in an unnecessarily antagonistic manner ("I can't believe that you devs did not [...]"). There's no need to question the motives of the Devs in having not already included your brilliant suggestion. It's much more effective to just check whether they have, and if they haven't to say: "Here's my idea. Here's why it's a good idea. It would be awesome if you could implement it, please.".

P.S. "Giving your idea the best chance of being accepted" (link in my .sig) is worth a read.
200g
Posts: 13
Joined: April 2nd, 2008, 1:08 pm
Location: Bad Segeberg, Germany
Contact:

Re: [WML] multi line comments

Post by 200g »

irrevenant wrote:(2) You made that suggestion in an unnecessarily antagonistic manner ("I can't believe that you devs did not [...]"). There's no need to question the motives of the Devs in having not already included your brilliant suggestion. It's much more effective to just check whether they have, and if they haven't to say: "Here's my idea. Here's why it's a good idea. It would be awesome if you could implement it, please.".
I apologize if my request seems to be harsh and antagonistic. This was absolutely not my intention.

EDIT: to make this clear: When I wrote "I can't believe..." that was totally meant in a funny way. It was actually NOT out of respect for the devs who made this amazing game. I don't know if its a case of "lost in translation" or if it's just my special kind of humour. I'd say it's the latter so please don't be mad at me devs. I love you :)
Last edited by 200g on April 16th, 2008, 10:22 pm, edited 2 times in total.
If you open your mind too much, your brain will fall out.
CarpeGuitarrem
Posts: 250
Joined: November 19th, 2007, 7:46 pm
Location: One among the Fence

Re: [WML] multi line comments

Post by CarpeGuitarrem »

200g wrote:
irrevenant wrote:(2) You made that suggestion in an unnecessarily antagonistic manner ("I can't believe that you devs did not [...]"). There's no need to question the motives of the Devs in having not already included your brilliant suggestion. It's much more effective to just check whether they have, and if they haven't to say: "Here's my idea. Here's why it's a good idea. It would be awesome if you could implement it, please.".
I apologize if my request seems to be harsh and antagonistic. This was absolutely not my intention.
Quite possibly an example of "lost in translation"...the poster is from Germany, after all.

I agree 100% on this. In fact, why not just have the engine parse from "#" to "/"? So you can comment like such...

# Line one of the comment
And it continues down here
And even this far...
Until this line /
Glory in Blood...Needs Programming Help!

If you have time, check out my ongoing serial story...
The Hidden: Secrets of the Future's Past
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Re: [WML] multi line comments

Post by turin »

Because 1) You might want the "/" character in a comment and 2) the "#" character is commonly used as a one-line comment symbol in various languages (I know it serves that purpose in shell scripts, at least) and it would be confusing for WML to appear to follow that convention but actually not.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
200g
Posts: 13
Joined: April 2nd, 2008, 1:08 pm
Location: Bad Segeberg, Germany
Contact:

Re: [WML] multi line comments

Post by 200g »

I agree with Turin. Whatever ends the comment should at least have two signs as in C++ to make it less likely that you want to use it in the comment itself.
If you open your mind too much, your brain will fall out.
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Re: [WML] multi line comments

Post by turin »

Something like

Code: Select all

###Multi
Line
Comment###
Would be fine, IMO.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
User avatar
Unnheulu
Posts: 738
Joined: November 25th, 2007, 4:50 pm
Location: Cymru
Contact:

Re: [WML] multi line comments

Post by Unnheulu »

Or perhaps something like:

Code: Select all

#Single line
\* Multiline *\
'''Multiline'''
hunz
Posts: 69
Joined: June 22nd, 2005, 4:04 pm
Contact:

Re: [WML] multi line comments

Post by hunz »

I stay with

Code: Select all

/* multi
line
comments
are
cool */
Wesnoth's main code is on C++, why not keep the standards?
User avatar
Iris
Site Administrator
Posts: 6797
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: [WML] multi line comments

Post by Iris »

Because WML != C++; nor in paradigm, nor in syntax.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
uzytkownik
Posts: 126
Joined: April 19th, 2008, 7:12 pm
Contact:

Re: [WML] multi line comments

Post by uzytkownik »

I guess there are 3 types of comments which appears in most of languages (there are others but usually they are limited to single language):
  • Sh-style comments (perl, php, sh, ruby...)

    Code: Select all

    # Comment
  • C-style comments (c, c++, php, java, ...)

    Code: Select all

    /* Commant
    in
    many lines*/
  • C++-style comments (c++, c99, php, java...)

    Code: Select all

    // Comment
I guess the implementation of C and C++ style comments would be consistent with rule of least surprise.
Post Reply