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
0: AstIndex
The root of the lookup chain
Id(ConstantIndex)
Tuple Fields
A .
access using an identifier
Str(AstString)
Tuple Fields
0: AstString
A .
access using a string
Index(AstIndex)
Tuple Fields
0: AstIndex
An index operation using square []
brackets.
Call
Fields
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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for LookupNode
impl Send for LookupNode
impl Sync for LookupNode
impl Unpin for LookupNode
impl UnwindSafe for LookupNode
Blanket Implementations
Mutably borrows from an owned value. Read more