blues-lsp 0.1.3

LSP language server for the Bluespec SystemVerilog language
Documentation
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum TreeKind {
    Error,
    Package,
    Stmt,
    AttributeList,
    Attribute,
    AttributeName,
    AttributeValue,
    AttributeValueList,
    ImportItem,
    ExportItem,
    FunctionProto,
    FunctionParamList,
    FunctionParam,
    ModuleParamList,
    TypedName,
    ModuleParam,
    ModulePortList,
    ModulePort,
    ModulePortParam,
    ProvisoList,
    DeclPattern,
    DeclPatternList,
    VarInitList,
    VarInitTarget,
    ArrayDim,
    VarInit,
    Case,
    CaseMatchList,
    CaseIfList,
    CaseIf,
    CaseIfCondList,
    CaseMatch,
    CaseDefault,
    CaseMatchCond,
    PatternBind,
    PatternWildcard,
    PatternLiteral,
    PatternList,
    PatternEnum,
    PatternField,
    PatternStruct,
    PatternInParens,
    PatternTagged,
    QualId,
    FunctionArg,
    FieldInit,
    InitList,
    Body,
    TypedFunName,
    TypedefParamList,
    TypedefParam,
    InterfaceBody,
    InterfaceItemMethod,
    InterfaceItemSubinterface,
    InterfaceItem,
    TypedefAlias,
    EnumVariantList,
    Subscript,
    EnumVariant,
    TypedefEnum,
    Derives,
    StructField,
    StructFieldList,
    TypedefStruct,
    TypedefFieldList,
    TypedefUnion,
    DependencyTypeList,
    DependencyList,
    TypeclassFunction,
    TypeclassModule,
    TypeclassVar,
    TypeclassBody,
    Dependency,
    InstanceBody,
    InstanceVar,
    InstanceModule,
    InstanceFunction,
    StartClause,
    EndClause,
    BindAssign,
    BindDecl,
    BindMatch,
    PkgId,
    BindList,
    ForInit,
    BviStub,
    BviInterface,
    SoftKw,

    /* Do not reorder! See TreeKind::is_stmt */
    StmtImport,
    StmtExport,
    StmtModule,
    StmtReturn,
    StmtFunction,
    StmtRule,
    StmtMethod,
    StmtIfElse,
    StmtAbortif,
    StmtCase,
    StmtRepeat,
    StmtWhile,
    StmtBreak,
    StmtContinue,
    StmtGoto,
    StmtAction,
    StmtActionvalue,
    StmtBlock,
    StmtSeq,
    StmtPar,
    StmtSubinterface,
    StmtInterface,
    StmtTypedef,
    StmtTypeclass,
    StmtExprOrBind,
    StmtFor,
    StmtBdpi,
    StmtBvi,
    StmtInstance,
    /* Do not reorder! See TreeKind::is_stmt */

    /* Do not reorder! See TreeKind::is_expr */
    ExprPrefixOp,
    ExprLit,
    ExprAttributes,
    ExprAction,
    ExprActionvalue,
    ExprRules,
    ExprBlock,
    ExprInterface,
    ExprCase,
    ExprBitConcat,
    ExprSystask,
    ExprValueof,
    ExprStringof,
    ExprVar,
    ExprCast,
    ExprModule,
    ExprInParens,
    ExprDontCare,
    ExprField,
    ExprCall,
    ExprSubscript,
    ExprBinary,
    ExprMatches,
    ExprTernary,
    ExprTagged,
    ExprStructInit,
    ExprSeq,
    ExprPar,
    /* Do not reorder! See TreeKind::is_expr */

    /* Do not reorder! See TreeKind::is_type */
    TypeBit,
    TypeInt,
    TypeReal,
    TypeVoid,
    TypeAction,
    TypeActionvalue,
    TypeArgList,
    TypeFunction,
    TypeModule,
    TypeLiteral,
    TypeCons,
    TypeVar,
    TypeApp,
    TypeInParens,
    /* Do not reorder! See TreeKind::is_type */
}

impl TreeKind {
    pub fn is_stmt(self) -> bool {
        use TreeKind::{StmtImport, StmtInstance};
        StmtImport <= self && self <= StmtInstance
    }

    pub fn is_expr(self) -> bool {
        use TreeKind::{ExprPar, ExprPrefixOp};
        ExprPrefixOp <= self && self <= ExprPar
    }

    pub fn is_type(self) -> bool {
        use TreeKind::{TypeBit, TypeInParens};
        TypeBit <= self && self <= TypeInParens
    }
}