mIRC Home    About    Download    Register    News    Help

Print Thread
#123920 29/06/05 04:56 AM
Joined: Apr 2004
Posts: 218
P
Fjord artisan
OP Offline
Fjord artisan
P
Joined: Apr 2004
Posts: 218
I'm not for sure if this is a bug or not, but recently when testing things out. I sometimes make comments of old codes to make sure I don't messs the code up when editing.

I noticed it you have:
Quote:

alias testing {
/* Hi! */
echo -a Hi!
}


It says there is a bracket mismatch. But obviously there isn't.
Though if you have:

Quote:

alias testing {
/* Hi
*/
echo -a hi!
}


It works normally.
Am I just not doing something right, or is this an bug? .-.

#123921 29/06/05 05:00 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
/* and */ are meant to be at the start of the line.

See this.

#123922 29/06/05 05:05 AM
Joined: Apr 2004
Posts: 218
P
Fjord artisan
OP Offline
Fjord artisan
P
Joined: Apr 2004
Posts: 218
Well, reading it, the parser thing should instead of jumping to the next line trying to find */ should read for the */ ;(


Live to Dream & Dream for Life
#123923 29/06/05 05:10 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
It seems pretty intentional behaviour and so beyond the realms of a bug. IMO this is more of a Feature Suggestion, but I can see how it might be taken as a bug I suppose...

Either way I'd like to see this changed.

#123924 29/06/05 06:07 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
mIRC uses unquoted strings, so if you had a peice of text that contained */ in it and you tried to enclose it in a multi-line comment it could create major bugs by ending the comment prematurely without the scripter knowing.

In short, changing this behaviour would be a very big mistake.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#123925 29/06/05 08:25 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
If it only interpreted */ as an end of the comment if a comment was already started with /* then there would be no problem (or atleast, not a very big one).

#123926 29/06/05 08:28 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I can see problems with regex if you wanted to put a regex code into a comment like that.

Much easier to put multi-line comments or else use a semicolon.

Code:
alias testing {
  ; Hi!
  echo -a Hi!
}


Anything wrong with just doing that?


Invision Support
#Invision on irc.irchighway.net
#123927 29/06/05 08:41 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Quote:
I can see problems with regex if you wanted to put a regex code into a comment like that.

Only if the regex wants to match 0 or more forward slashes, which isn't particularly likely but ok...

My support is dropped, however, since I just noticed this works fine, without the need to put */ on a new line...

/* moo
*/ moo

So there's really no need to change it.


Link Copied to Clipboard