Page 1 of 1

Comments in scripts in form sections should be allowed to end with multiple * signs

Posted: 14 Jun 2022, 08:14
by A Keymaker
if I am not mistaken a comment area in scripts can begin not only with

Code: Select all

/*
but also

Code: Select all

/**
and even

Code: Select all

/********************************************************************************


But on the other hand this version of comments has to end with

Code: Select all

*/
because using even as little as

Code: Select all

**/
is not viewed as a end-comment-section marker - thus the comment section continues until it reaches either a marker for star-comment-section or end of the script


This is inconsistent behavior and in my opinion allowing for multiple * signs before / sign would allow users to mark sections of their codes in a more graphical and at the same time unified way

Re: Comments in scripts in form sections sgould be allowed to end with multiple * signs

Posted: 14 Jun 2022, 09:23
by gregster
It's consistent in a way that both, /* and */, have to be at a line start, in AHK v1.
Afaik, */ is already allowed at the line end in AHK v2.
I wouldn't expect a change of the v1 behaviour (and it could break code), but if you wanted to suggest it, the Editors subforum wouldn't be the right place, since it's a language feature, and editors have no influence on it. The Wish List subforum would be more appropriate, imo.

Re: Comments in scripts in form sections sgould be allowed to end with multiple * signs

Posted: 15 Jun 2022, 12:22
by A Keymaker
gregster wrote:
14 Jun 2022, 09:23
[...]
if you wanted to suggest it, the Editors subforum wouldn't be the right place
[...]
I just did: viewtopic.php?f=13&t=105390

Thank you for the info

Re: Comments in scripts in form sections should be allowed to end with multiple * signs

Posted: 17 Jun 2022, 22:24
by lexikos
/* is the marker to start a comment. The rest of the line is just a part of the comment. I can start a comment like

Code: Select all

/*THIS IS MY COMMENT
This is also my comment
but by your logic,

Code: Select all

THIS IS MY COMMENT*/
should also be allowed to end the comment.

And it is. In v2.

(Again, */ is the end marker for the comment. Any asterisks preceding it are just meaningless characters.)