macro comment [ignore] {common if 0}
macro endcomment [ignore] {common end if}

comment ********
... any text ...
... and still ...
endcomment ********
Posted on 2002-12-12 12:21:10 by tserk
Cool!
Posted on 2002-12-12 13:11:55 by POW
Had those (thanks to Privalov) since long ago.. but they have a problem: they still parse the source inside.. so it's easy to get errors if you put the wrong thing inside the commented block.

Probably the only fully working solution is to have this feature for real, in FASM.. and not under the form of a MACRO.
Posted on 2002-12-12 15:11:32 by Maverick
One idea...

Maybe, for better optimization of parser and preprocessor:


if 0 & some_undefined_value ; always all right
... and no parsed this!
end if
if 0 | some_undefined_value ; error in preprocessed time, and no parser error...


Execuse me, if :stupid:
Posted on 2002-12-13 04:19:51 by tserk
The problem is that FASM will anyway have to parse what's inside the block, so if you had an "end if" inside the stuff you want to comment, then you get in big trouble. I just don't use this "feature" because of this.

Now, if only FASM had a true nested block feature, i.e. some special characters like:


*[
to begin the block and:


]*
to end the block, one should only worry about those, not about other "end if" or similar.. let away that currently FASM reports an error, IIRC, also if it encounters bad syntax among x86 instructions.

I proposed this suggestion several times to Privalov, but of course we can't pretend from him to work fulltime on all our wishes. FASM is already great as-is anyway, and he has done a hell of work already.
Still, me and you aren't the only ones who wish to see true nested block comment support in FASM.. so maybe someday we'll see it. :)
Posted on 2002-12-13 05:10:56 by Maverick
Yes, I still have it on the TODO list (altough not in the first place, neither the second), so it's possible it'll get implemented one day (like many other features was implemented even when I thought it was impossible).
About the "workarounds": you can also comment something like here:


macro comment {

almost anything

}

This even won't get parsed, but you can't use '}' character inside, and you still have to close all quotations (it's needed for preprocessor).
Posted on 2002-12-13 05:20:52 by Tomasz Grysztar
Hi Privalov :)
The latest workaround would work ok for me, since those specific constraints aren't a limitation for me. :alright:
Posted on 2002-12-13 05:36:21 by Maverick
..well, only thing is that they can't be nested, so if someday FASM will support this feature, it will be welcomed anyway. :)
The only constraint on quotes is IMHO right and natural, BTW.. no need to try to remove it.
Posted on 2002-12-13 06:08:35 by Maverick
Thanks Privalov for better "comment" macro.
Artist is always Artist :alright:
The FASM already in stable stage :alright:

PS
In addition:
more frequent has to comment the code areas.
In this case works correctly all aforesaid.
Posted on 2002-12-13 06:54:47 by tserk