Re: Multiple lines

From: frank (fmankal_at_sehcomp.ca)
Date: 04/07/04


Date: Wed, 07 Apr 2004 20:27:42 GMT


"Charles Demas" <demas@TheWorld.com> wrote in message
> news:c51e2c$p2j$1@pcls3.std.com...
> <snip>
> > >>
> > >>/^[[:blank:]]*fn(/ {
> > >> n
> > >> /);/ {
> > >> s/);/, new_arg&/
> > >> }
> > >>}
> > >>
> > >>which will find "fn" and append the "new_arg" at the end. Great. But
> there
> > >>is no guarantee that the function will be two lines. Once I've found
> "fn"
> > >>how do I loop/check until I see the end of the function call ");"?
> > >>
> > >>
> > >
> > >Try this:
> > >
> > >/^[[:blank:]]*fn(/, /);/ {
> > > n
> > > /);/ {
> > > s/);/, new_arg&/
> > > }
> > >}
> >
> > Or maybe this:
> >
> > /^[[:blank:]]*fn(/, /);/ {
> > /);/ {
> > s/);/, new_arg&/
> > }
> > }

What about if I wanted to replace the entire function call with something
else? The following is giving me multiple lines of "newfunc(newparms);"

/^[[:blank:]]*func(/, /);/ {
   c\newfunc(newparms);
}

what am I missing?