Skip to main content

crashtest.hxsmith.features.enums

Enums and enum abstracts: construction, pattern matching (guards, or-patterns, nesting), helper functions.

class Arm​

pattern: str​

guard: Optional[str]​

binds: List[Tuple[str, Ty]]​

init​

def __init__(pattern: str, guard: Optional[str], binds: List[Tuple[str, Ty]]) -> None

class Ctor​

name: str​

args: List[Ty]​

init​

def __init__(name: str, args: List[Ty]) -> None

class Enums(Feature)​

name​

name = 'enums'

summary​

summary = 'enums, enum abstracts, pattern matching with guards/or-patterns/nesting, .match, helpers'

covers​

covers = ('EEnum', 'EAbstract', 'ESwitch', 'FVar', 'FFun', 'AStatic', 'AInline', 'APublic', 'decl:enum_abstract')

order​

order = 28

declare​

def declare(g: Gen) -> None

types​

def types(g: Gen, depth: int)

show​

def show(g: Gen, ty: Ty, expr: str) -> Optional[str]

exprs​

def exprs(g: Gen, ty: Ty)

stmts​

def stmts(g: Gen)

class Spec​

ty: Ty​

ctors: List[Ctor]​

underlying: Optional[Ty]​

underlying = None

leaves: List[Ctor]​

recursive: bool​

init​

def __init__(ty: Ty, ctors: List[Ctor], underlying: Optional[Ty] = None) -> None

class State​

specs: Dict[Ty, Spec]​

helpers: Dict[Ty, str]​

init​

def __init__(specs: Dict[Ty, Spec], helpers: Dict[Ty, str]) -> None