[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep can help?

From: Barry Margolin
Subject: Re: grep can help?
Date: Thu, 22 Apr 2004 10:14:33 -0400
User-agent: MT-NewsWatcher/3.4 (PPC Mac OS X)

In article <c68a4v$b39$>, FCC <> 

> Albert Reiner wrote:
> > Just to point out the obvious: This does not take into account
> > exclamation marks in string constants, and the standard also allows
> > you to write F90 in fixed format in which case you might use ! in
> > column 5 (?) for continuation lines.  Of course it depends on your
> > code whether this is a problem; a general solution would need to parse
> > F90 in both formats.
> > 
> > Albert.
> I see. I think your 2nd point is not an example of good programming, so 
> I would not worry about it. But your 1st point needs to be taken care 
> of: replace-regexp "\B!.*" " " and all the comments will be gone, 
> respecting the ! inside the strings, as long as they don't come with a 
> preceding whitespace. But if they do, this is again not a good practice, 
> normally for example you write "Nice to see you!", but not "Nice to see 
> you !".
> FCC.

That's true if the strings contain normal prose text.  But suppose you 
were writing a program that adds comments to programs.  It's likely to 
contain " ! " as a string.

Barry Margolin,
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

reply via email to

[Prev in Thread] Current Thread [Next in Thread]