@@ -261,6 +261,7 @@ BNopt {BN}*
261
261
BL [ \t\r]*" \n "
262
262
B [ \t]
263
263
Bopt {B}*
264
+ NOTopt ((" !" {BNopt})|(" not" {BN}+))?
264
265
DIGIT [0-9]
265
266
HEXDIGIT ({DIGIT}|[a-f]|[A-F])
266
267
ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
@@ -2298,20 +2299,10 @@ NONLopt [^\n]*
2298
2299
yyextra->roundCount=0;
2299
2300
BEGIN( CopyRound ) ;
2300
2301
}
2301
- <RequiresClause>{ID} { // something like " requires true "
2302
- if (startOfRequiresExpression(yyextra->current->req))
2303
- {
2304
- yyextra->current->req=yytext;
2305
- BEGIN(yyextra->requiresContext);
2306
- }
2307
- else
2308
- {
2309
- REJECT;
2310
- }
2311
- }
2312
- <RequiresClause>{SCOPENAME}{BNopt}" (" { // " requires func (x)"
2302
+ <RequiresClause>{NOTopt}{SCOPENAME}{BNopt}" (" { // " requires func (x)"
2313
2303
if (startOfRequiresExpression(yyextra->current->req))
2314
2304
{
2305
+ lineCount(yyscanner);
2315
2306
yyextra->current->req+=yytext;
2316
2307
yyextra->lastRoundContext=RequiresClause;
2317
2308
yyextra->pCopyRoundString=&yyextra->current->req;
@@ -2323,9 +2314,10 @@ NONLopt [^\n]*
2323
2314
REJECT;
2324
2315
}
2325
2316
}
2326
- <RequiresClause>{SCOPENAME}{BNopt}" <" { // " requires C<S,T>"
2317
+ <RequiresClause>{NOTopt}{ SCOPENAME}{BNopt}" <" { // " requires C<S,T>"
2327
2318
if (startOfRequiresExpression(yyextra->current->req))
2328
2319
{
2320
+ lineCount(yyscanner);
2329
2321
yyextra->current->req+=yytext;
2330
2322
yyextra->lastSharpContext=RequiresClause;
2331
2323
yyextra->pCopySharpString=&yyextra->current->req;
@@ -2337,10 +2329,24 @@ NONLopt [^\n]*
2337
2329
REJECT
2338
2330
}
2339
2331
}
2340
- <RequiresClause>" ::" {ID} {
2332
+ <RequiresClause>{NOTopt}{SCOPENAME} { // something like " requires true " or " requires !my::value"
2333
+ if (startOfRequiresExpression(yyextra->current->req))
2334
+ {
2335
+ lineCount(yyscanner);
2336
+ yyextra->current->req=yytext;
2337
+ BEGIN(yyextra->requiresContext);
2338
+ }
2339
+ else
2340
+ {
2341
+ REJECT;
2342
+ }
2343
+ }
2344
+ <RequiresClause>{NOTopt}" ::" {ID} {
2345
+ lineCount(yyscanner);
2341
2346
yyextra->current->req+=yytext;
2342
2347
}
2343
- <RequiresClause>" ||" |" &&" { // " requires A || B" or " requires A && B"
2348
+ <RequiresClause>" ||" |" &&" |" !" |(" or " {BN}+)|(" and " {BN}+)|(" not " {BN}+) { // " requires A || B" or " requires A && B"
2349
+ lineCount(yyscanner);
2344
2350
yyextra->current->req+=yytext;
2345
2351
}
2346
2352
<RequiresClause>{BN}+ {
@@ -7506,7 +7512,7 @@ static QCString stripFuncPtr(const QCString &type)
7506
7512
static bool startOfRequiresExpression(const QCString &req)
7507
7513
{
7508
7514
QCString r = req.stripWhiteSpace();
7509
- return r.isEmpty() || r.endsWith(" &&" ) || r.endsWith(" ||" );
7515
+ return r.isEmpty() || r.endsWith(" &&" ) || r.endsWith(" ||" ) || r.endsWith( " and " ) || r.endsWith( " or " ) ;
7510
7516
}
7511
7517
7512
7518
//-----------------------------------------------------------------
0 commit comments