source: icGREP/icgrep-devel/icgrep/re/re_parser_ere.cpp

Last change on this file was 5181, checked in by xwa163, 14 months ago

fix undefined vtable caused by llvm O3 optimization for inline function

File size: 917 bytes
Line 
1/*
2 *  Copyright (c) 2016 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#include <re/re_parser_ere.h>
8#include <re/re_parser_helper.h>
9
10namespace re{
11
12    // \d and \D removed
13    const uint64_t setEscapeCharacters = bit3C('b') | bit3C('p') | bit3C('q') | bit3C('w') | bit3C('s') | bit3C('<') | bit3C('>') |
14                                         bit3C('B') | bit3C('P') | bit3C('Q') | bit3C('W') | bit3C('S') | bit3C('N') | bit3C('X');
15
16    bool RE_Parser_ERE::isSetEscapeChar(char c) {
17        return c >= 0x3C && c <= 0x7B && ((setEscapeCharacters >> (c - 0x3C)) & 1) == 1;
18    }
19
20    inline bool RE_Parser_ERE::isUnsupportChartsetOperator(char c) {
21        switch (c) {
22            case '\\':
23                return true;
24            default:
25                return false;
26        }
27    }
28}
Note: See TracBrowser for help on using the repository browser.