cmLex.h/.c: Added cmLexFilterFlags() and cmLexSetFilterFlags().

This commit is contained in:
kevin 2013-02-15 21:38:01 -08:00
parent 9b9e626287
commit 3c807d08c9
2 changed files with 18 additions and 0 deletions

12
cmLex.c
View File

@ -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 )
{

View File

@ -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 );