flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Remove Comments Before Concatenation

Author
Thread Post new topic Reply to topic
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
If you use \ operator for line concatenation, but have a comment somewhere inside the whole block that is to be concatenated, FASM fails. It concatenates comment into the block? It should skip it?

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 11 Mar 2004, 01:58
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 875
Location: Colombia
pelaillo
please see the second post here and the answer from Privalov... http://board.flatassembler.net/topic.php?p=3696&highlight=#3696
Post 11 Mar 2004, 02:53
View user's profile Send private message Yahoo Messenger Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
He thinks strangely...

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 11 Mar 2004, 03:02
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
comrade wrote:
He thinks strangely...

He is absolutely right here. You have to meditate a little on this subject, like me, to understand the matter. Wink

Regards.
Post 15 Mar 2004, 10:33
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 875
Location: Colombia
pelaillo
Sorry, I don't agree at all.

Both reasons are logic and good. It depends only in the sequence of operations. If preprocessor does the concatenation before, then the consequence is that Privalov´s way is the better.

But if preprocessor cut out the comments before (imho is the first thing a preprocessor must do in a compiler) the logic employed by us is right.

But the matter is different. We are asking for a feature here. It is more comfortable to have comments stripped before. I have given some examples, and here is another:
Code:
CSTR_TABLE html_reserved_words,\
               <1,'a'>,\
\;               <1,'b'>,\
\;               <1,'i'>,\
          <1,'p'>,\
\;               <1,'q'>,\
\;               <1,'s'>,\
\;               <1,'u'>,\
          <2,'br'>,\
\;              <2,'dd'>,\
\;              <2,'dl'>,\
\;              <2,'dt'>,\
\;              <2,'em'>,\
\;              <8,'noscript'>,\
\;                <8,'optgroup'>,\
\;                <8,'textarea'>,\
           <10,'blockquote'>
    
Post 15 Mar 2004, 12:43
View user's profile Send private message Yahoo Messenger Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7520
Location: Kraków, Poland
Tomasz Grysztar
No matter if you strip the comments before or later, there is always the beginning of line (the "white space" before the semicolon) that is not a part of comment - and this empty space is seen by the preprocessor as a contents of the line and is used for concatenation.
Post 15 Mar 2004, 13:29
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
pelaillo wrote:
Sorry, I don't agree at all.


Well, I am totally confused, who assert what... Very Happy
To clear the things:

I think that FASM in it's present variant concatenates lines absolutely right. It do not need any imrovement in this point. Smile

Regards.
Post 15 Mar 2004, 14:53
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 875
Location: Colombia
pelaillo
This was a "feature request" not a "bug report" Laughing

And I have seen your point, I have considered it and still prefer the other way arround.

An only-comment-line is a nonexistent line at all. Preporcessor is able to identify them without getting tricky and without loosing logic.

I am only saying that is a feature that you win during code writing, editors let you to (un)comment bunch of lines and your code gains in readability. Comments live only in programmers realm. They are not used at all in further steps of compiling process.

I want to contribute, not to disturb. Sorry for the incomprehension but english is not my language.
Post 15 Mar 2004, 15:06
View user's profile Send private message Yahoo Messenger Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7520
Location: Kraków, Poland
Tomasz Grysztar
pelaillo wrote:
An only-comment-line is a nonexistent line at all.

Not in fasm's architecture. It's an empty line, the same as the one you achieve with just putting one CR-LF after another.
Post 15 Mar 2004, 15:32
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7108
Location: Slovakia
vid
privalov is right. keep it as is, it's allright
Post 15 Mar 2004, 20:11
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.