MCPcopy Create free account
hub / github.com/astral-sh/ruff / new

Method new

crates/ruff_python_parser/src/token_set.rs:8–18  ·  view source on GitHub ↗
(kinds: [TokenKind; N])

Source from the content-addressed store, hash-verified

6
7impl TokenSet {
8 pub(crate) const fn new<const N: usize>(kinds: [TokenKind; N]) -> TokenSet {
9 let mut res = 0u128;
10 let mut i = 0usize;
11
12 while i < N {
13 let kind = kinds[i];
14 res |= mask(kind);
15 i += 1;
16 }
17 TokenSet(res)
18 }
19
20 pub(crate) const fn union(self, other: TokenSet) -> TokenSet {
21 TokenSet(self.0 | other.0)

Callers

nothing calls this directly

Calls 2

maskFunction · 0.85
TokenSetClass · 0.85

Tested by

no test coverage detected