瀏覽代碼

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

master
kevin 11 年之前
父節點
當前提交
3c807d08c9
共有 2 個文件被更改,包括 18 次插入0 次删除
  1. 12
    0
      cmLex.c
  2. 6
    0
      cmLex.h

+ 12
- 0
cmLex.c 查看文件

@@ -637,6 +637,18 @@ cmRC_t             cmLexRegisterMatcher( cmLexH h, unsigned id, cmLexUserMatcher
637 637
   return _cmLexInstallMatcher( p, id, NULL, NULL, userPtr );
638 638
 }
639 639
 
640
+unsigned           cmLexFilterFlags( cmLexH h )
641
+{
642
+  cmLex* p = _cmLexHandleToPtr(h);
643
+  return p->flags;
644
+}
645
+
646
+void               cmLexSetFilterFlags( cmLexH h, unsigned flags )
647
+{
648
+  cmLex* p = _cmLexHandleToPtr(h);
649
+  p->flags = flags;
650
+}
651
+
640 652
 
641 653
 unsigned           cmLexGetNextToken( cmLexH h )
642 654
 {

+ 6
- 0
cmLex.h 查看文件

@@ -84,6 +84,12 @@ typedef unsigned (*cmLexUserMatcherPtr_t)( const cmChar_t* cp, unsigned cn );
84 84
 
85 85
 cmRC_t             cmLexRegisterMatcher( cmLexH h, unsigned id, cmLexUserMatcherPtr_t funcPtr );
86 86
 
87
+// Get and set the lexer filter flags kReturnXXXLexFl.
88
+// These flags can be safely enabled and disabled between
89
+// calls to cmLexGetNextToken().
90
+unsigned           cmLexFilterFlags( cmLexH h );
91
+void               cmLexSetFilterFlags( cmLexH h, unsigned flags );
92
+
87 93
 // Return the type id of the current token and advances to the next token
88 94
 unsigned           cmLexGetNextToken( cmLexH h );
89 95
 

Loading…
取消
儲存