From 3c807d08c9ef25534d9dc42a8d8494a96511a5f9 Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 15 Feb 2013 21:38:01 -0800 Subject: [PATCH] cmLex.h/.c: Added cmLexFilterFlags() and cmLexSetFilterFlags(). --- cmLex.c | 12 ++++++++++++ cmLex.h | 6 ++++++ 2 files changed, 18 insertions(+) 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 );