diff --git a/cmLex.c b/cmLex.c index f938c50..b8371db 100644 --- a/cmLex.c +++ b/cmLex.c @@ -637,6 +637,18 @@ cmRC_t cmLexRegisterMatcher( cmLexH h, unsigned id, cmLexUserMatcher return _cmLexInstallMatcher( p, id, NULL, NULL, userPtr ); } +unsigned cmLexFilterFlags( cmLexH h ) +{ + cmLex* p = _cmLexHandleToPtr(h); + return p->flags; +} + +void cmLexSetFilterFlags( cmLexH h, unsigned flags ) +{ + cmLex* p = _cmLexHandleToPtr(h); + p->flags = flags; +} + unsigned cmLexGetNextToken( cmLexH h ) { diff --git a/cmLex.h b/cmLex.h index 330e214..102e098 100644 --- a/cmLex.h +++ b/cmLex.h @@ -84,6 +84,12 @@ typedef unsigned (*cmLexUserMatcherPtr_t)( const cmChar_t* cp, unsigned cn ); cmRC_t cmLexRegisterMatcher( cmLexH h, unsigned id, cmLexUserMatcherPtr_t funcPtr ); +// Get and set the lexer filter flags kReturnXXXLexFl. +// These flags can be safely enabled and disabled between +// calls to cmLexGetNextToken(). +unsigned cmLexFilterFlags( cmLexH h ); +void cmLexSetFilterFlags( cmLexH h, unsigned flags ); + // Return the type id of the current token and advances to the next token unsigned cmLexGetNextToken( cmLexH h );