This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [testsuite] gdb.c++/templates.exp


Daniel Berlin <dberlin@dberlin.org> writes:

|> On Wednesday, July 9, 2003, at 11:15 AM, Daniel Berlin wrote:
|> 
|> >
|> > On Wednesday, July 9, 2003, at 11:05 AM, Michael Elizabeth Chastain
|> > wrote:
|> >
|> >> Hi Michal,
|> >>
|> >> This part is not quite correct:
|> >>
|> >>   \\(unsigned ?(long|)\\);
|> >>
|> >> It would accept 'unsignedlong' which would be wrong.
|> >
|> > It shouldn't, unless the regex isn't whitespace sensitive
|> 
|> Just to be clear, this regex should accept nothing, "long", "unsigned
|> long", and "unsigned".
|> This may be *wrong*, but it certainly shouldn't accept "unsignedlong".
|> The ? should be applying to "unsigned ", not just the whitespace.

It surely doesn't.  Repetition operators only apply to the smallest
preceding group.

The fixed prefix is "(unsigned", then comes an optional " ", then an
optional "long", then the fixed postfix ");".  All in all it matches
exactly four strings:

"(unsigned);"
"(unsigned );"
"(unsignedlong);"
"(unsigned long);"

Only the first and the fourth are desired.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]