Enum kailua_syntax::ast::K [] [src]

pub enum K {
    Oops,
    Dynamic,
    Any,
    Nil,
    Boolean,
    BooleanLit(bool),
    Number,
    Integer,
    IntegerLit(i32),
    String,
    StringLit(Str),
    Table,
    EmptyTable,
    Record(Vec<(Spanned<Str>, Spanned<SlotKind>)>, bool),
    Tuple(Vec<Spanned<SlotKind>>),
    Array(Spanned<SlotKind>),
    Map(Spanned<Kind>, Spanned<SlotKind>),
    Function,
    Func(Spanned<FuncKind>),
    Thread,
    UserData,
    Named(Spanned<Name>),
    WithNil(Spanned<Kind>),
    WithoutNil(Spanned<Kind>),
    Union(Vec<Spanned<Kind>>),
    Attr(Spanned<Kind>, Spanned<Attr>),
    Error(Option<Spanned<Str>>),
}

A Kailua type.

The syntax-level type is actually termed a "kind", because this and the actual type are frequently used altogether, and it is not really a "type" but a specification that leads to a type.

Variants

An error type resulting from a parsing error.

WHATEVER.

any.

nil.

boolean or bool.

A boolean literal type (true or false).

number.

integer or int.

An integral literal type.

string.

A string literal type.

table.

{}.

{a: T, b: U} (inextensible) or {a: T, b: U, ...} (extensible).

The second bool is true if the record type is extensible.

{T, U}.

The tuple type is never extensible, though the checker can internally have extensible tuples.

vector<T>. (The name "array" is a historic artifact.)

map<T, U>.

function.

function(...) -> ....

thread.

userdata.

A named type.

T?.

The checker distinguishes a plain type and a "nilable" type, but in the syntax ? is considered a (non-associative) type operator.

T!.

The checker distinguishes a plain type and a "nilable" type, but in the syntax ! is considered a (non-associative) type operator.

T | U | ....

[attribute] T.

error "message". Currently parsed but not checked.

Trait Implementations

impl Clone for K
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for K
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Debug for K
[src]

Formats the value using the given formatter.