Off subject

Jussi Jumppanen jussij at zeusedit.com
Wed Jan 7 17:13:07 PST 2009


Vincent Richomme Wrote:

> Hul doesn't work because it matches some typedef struct like this :
> 
> typedef struct c_parser GTY(())
> {
> ...
> } c_parser;

That's what I meant when I said the regexp will almost certainly 
need to be tweaked ;)

For example this new 'tweaked' regexp search string:

  (^[_a-z0-9]+[ &*\t]+[_a-z0-9 &*\t]*[_a-z0-9]+[ \t]*\({0,1}[^\]+.(.*[^;]+)(\n{\n)

will distinguish bettween these two case:

  void myfunc(int aFoo)
  {
  ...
  }
    
  typedef struct c_parser GTY(())
  {
  ...
  } c_parser;

Obviously for each new case some extra tweaking of the repexp 
might be required.

But if you used something like SED you can make the searching a 
hell of a lot smarter.

SED allows you to define rules where by you can take the result 
of one search, run a second test against it and then accept or
reject the result based on the result of this second test.

  http://www.zeusedit.com/forum/viewtopic.php?t=1229

Using this approach you could define rules to filter out these 
exceptions.




More information about the Digitalmars-d mailing list