Enum koto_parser::LookupNode[][src]

pub enum LookupNode {
    Root(AstIndex),
    Id(ConstantIndex),
    Str(AstString),
    Index(AstIndex),
    Call {
        args: Vec<AstIndex>,
        with_parens: bool,
    },
}
Expand description

A node in a lookup chain

Lookups are any expressions that access a values from identifiers, and then as the lookup chain continues, from any following temporary results.

In other words, some series of operations involving indexing, . accesses, and function calls.

e.g. foo.bar."baz"[0](42) | | | | ^ Call {args: 42, with_parens: true} | | | ^ Index (0) | | ^ Str (baz) | ^ Id (bar) ^ Root (foo)

Variants

Root(AstIndex)

Tuple Fields

The root of the lookup chain

Id(ConstantIndex)

Tuple Fields

A . access using an identifier

Str(AstString)

Tuple Fields

A . access using a string

Index(AstIndex)

Tuple Fields

An index operation using square [] brackets.

Call

Fields

args: Vec<AstIndex>

The arguments used in the function call

with_parens: bool

Whether or not parentheses are present in the function call

This is not cosmetic, as parentheses represent a ‘closed call’, which has an impact on function piping: e.g. 99 >> foo.bar 42 is equivalent to foo.bar(42, 99) but: 99 >> foo.bar(42) is equivalent to foo.bar(42)(99).

A function call

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.