summaryrefslogtreecommitdiff
path: root/js/src/irregexp/RegExpCharacters-inl.h
blob: 25fce4030d3a1de286c203b02b6d1ff9d31b5f11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* Generated by make_unicode.py DO NOT MODIFY */
/* Unicode version: 11.0.0 */
#ifndef V8_JSREGEXPCHARACTERS_INL_H_
#define V8_JSREGEXPCHARACTERS_INL_H_

namespace js {

namespace irregexp {

static inline bool
RangeContainsLatin1Equivalents(CharacterRange range, bool unicode)
{
    if (unicode) {
        // "LATIN SMALL LETTER LONG S" case folds to "LATIN SMALL LETTER S".
        if (range.Contains(0x017F))
            return true;
        // "LATIN CAPITAL LETTER SHARP S" case folds to "LATIN SMALL LETTER SHARP S".
        if (range.Contains(0x1E9E))
            return true;
        // "KELVIN SIGN" case folds to "LATIN SMALL LETTER K".
        if (range.Contains(0x212A))
            return true;
        // "ANGSTROM SIGN" case folds to "LATIN SMALL LETTER A WITH RING ABOVE".
        if (range.Contains(0x212B))
            return true;
    }

    // "GREEK CAPITAL LETTER MU" case maps to "MICRO SIGN".
    // "GREEK SMALL LETTER MU" case maps to "MICRO SIGN".
    if (range.Contains(0x039C) || range.Contains(0x03BC))
        return true;
    // "LATIN CAPITAL LETTER Y WITH DIAERESIS" case maps to "LATIN SMALL LETTER Y WITH DIAERESIS".
    if (range.Contains(0x0178))
        return true;
    return false;
}

} } // namespace js::irregexp

#endif // V8_JSREGEXPCHARACTERS_INL_H_