Skip to main content

HalsteadType

Type Alias HalsteadType 

Source
pub type HalsteadType = TokenRole;
👎Deprecated since 2.3.0:

renamed to TokenRole: the classification is syntactic, not Halstead-specific

Expand description

The former name of TokenRole, kept so the metrics::halstead::HalsteadType path still resolves.

The classification never was Halstead-specific — it answers whether a node acts as an operator or an operand, which the grammar decides and other consumers can use (#1376). Renaming it outright would be a SemVer break, so the old spelling stays until the next major.

Aliased Type§

pub enum HalsteadType {
    Operator,
    Operand,
    Unknown,
}

Variants§

§

Operator

The node acts as an operator (+, &&, a call, an index).

§

Operand

The node acts as an operand (an identifier, a literal).

§

Unknown

The node plays neither role, so it is not counted.