• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pomsky-lang / pomsky / 12301483439

12 Dec 2024 05:19PM UTC coverage: 80.275% (-0.2%) from 80.471%
12301483439

push

github

Aloso
feat: test command

360 of 593 new or added lines in 11 files covered. (60.71%)

20 existing lines in 7 files now uncovered.

4607 of 5739 relevant lines covered (80.28%)

374427.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

70.83
/pomsky-lib/src/diagnose/feature.rs
1
/// A regex feature, which might not be supported in every regex flavor.
2
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
3
#[non_exhaustive]
4
pub enum Feature {
5
    /// Atomic groups, e.g. `(?>group)`
6
    AtomicGroups,
7
    /// Lookahead or lookbehind, e.g. `(?=lookahead)`
8
    Lookaround,
9
    /// A single grapheme cluster, `\X`
10
    Grapheme,
11
    /// Unicode scripts, e.g. `\p{Latin}`
12
    UnicodeScript,
13
    /// Unicode blocks, e.g. `\p{InBasic_Latin}`
14
    UnicodeBlock,
15
    /// Unicode properties, e.g. `\p{Whitespace}`
16
    UnicodeProp,
17
    /// A specific Unicode properties is not supported, even though most are,
18
    /// e.g. `\p{Bidi_Mirrored}` in Ruby
19
    SpecificUnicodeProp,
20
    /// Backreferences, e.g. `\4`
21
    Backreference,
22
    /// Forward references. They're like backreferences, but refer to a group
23
    /// that syntactically appears _after_ the reference
24
    ForwardReference,
25
    /// Negative `\w` shorthand, i.e. `[\W]`. This is not supported in
26
    /// JavaScript when polyfilling Unicode support for `\w` and `\d`.
27
    NegativeShorthandW,
28
    /// Negative `\s` shorthand, i.e. `[\S]`. This is not supported in
29
    /// RE2 when polyfilling Unicode support for `\s`.
30
    NegativeShorthandS,
31
    /// `\w` shorthand. This is not supported in RE2: It cannot polyfill Unicode
32
    /// support because `\p{Alphabetic}` is not supported
33
    ShorthandW,
34
    /// Having backreferences to both named and numbered groups is not supported
35
    /// in Ruby.
36
    MixedReferences,
37
    /// Lookarounds can't be repeated in Ruby, even when wrapped in a group
38
    RepeatedAssertion,
39
    /// Code points above U+FFFF in char classes
40
    LargeCodePointInCharClass(char),
41
    /// Recursion is only supported in PCRE and Ruby at the moment
42
    Recursion,
43
    /// Word boundaries in Unicode mode
44
    UnicodeWordBoundaries,
45
    /// Word start and word end is not supported in RE2
46
    WordStartEnd,
47
    /// Unicode script extensions, e.g. `[scx:Greek]`
48
    ScriptExtensions,
49
    /// Character set intersections
50
    CharSetIntersection,
51
    /// Repetition higher than 1000
52
    RepetitionAbove1000,
53
}
54

55
impl Feature {
56
    pub(super) fn name(self) -> &'static str {
21✔
57
        match self {
21✔
58
            Feature::AtomicGroups => "atomic groups",
1✔
59
            Feature::Lookaround => "lookahead/behind",
1✔
60
            Feature::Grapheme => "grapheme cluster matcher (\\X)",
1✔
61
            Feature::UnicodeScript => "Unicode scripts (\\p{Script})",
1✔
62
            Feature::UnicodeBlock => "Unicode blocks (\\p{InBlock})",
1✔
63
            Feature::UnicodeProp => "Unicode properties (\\p{Property})",
2✔
UNCOV
64
            Feature::SpecificUnicodeProp => "This particular Unicode property",
×
65
            Feature::Backreference => "backreference",
2✔
66
            Feature::ForwardReference => "forward reference",
1✔
67
            Feature::NegativeShorthandW => "negative \\w shorthand in character class",
×
UNCOV
68
            Feature::NegativeShorthandS => "negative \\s shorthand in character class",
×
UNCOV
69
            Feature::ShorthandW => "\\w shorthand",
×
70
            Feature::MixedReferences => "references to both named and numbered groups",
1✔
71
            Feature::RepeatedAssertion => "single repeated assertion",
6✔
72
            Feature::LargeCodePointInCharClass(_) => "code points above U+FFFF in char classes",
×
73
            Feature::Recursion => "recursion",
1✔
UNCOV
74
            Feature::UnicodeWordBoundaries => "word boundaries in Unicode mode",
×
UNCOV
75
            Feature::WordStartEnd => "word start and word end",
×
76
            Feature::ScriptExtensions => "Unicode script extensions",
1✔
77
            Feature::CharSetIntersection => "Character set intersections",
1✔
78
            Feature::RepetitionAbove1000 => "Repetition above 1000",
1✔
79
        }
80
    }
21✔
81
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc