Enum kailua_syntax::ast::Ex
[−]
[src]
pub enum Ex { Oops, Nil, False, True, Num(f64), Str(Str), Varargs, Func(Sig, Scope, Spanned<Block>), Table(Table), Var(Spanned<NameRef>), Exp(Spanned<Exp>), FuncCall(Spanned<Exp>, Spanned<Args>), MethodCall(Spanned<(Spanned<Exp>, Spanned<Name>)>, Spanned<Args>), Index(Spanned<Exp>, Spanned<Exp>), IndexName(Spanned<Exp>, Spanned<Name>), Un(Spanned<UnOp>, Spanned<Exp>), Bin(Spanned<Exp>, Spanned<BinOp>, Spanned<Exp>), }
An expression.
Variants
Oops
A dummy node resulting from a parsing error.
Technically the type checker "evaluates" this node into an error type.
Nil
nil
.
False
false
.
True
true
.
Num(f64)
A number literal.
Str(Str)
A string literal.
A difference between "string"
and [[string]]
is not recorded.
Varargs
...
.
Func(Sig, Scope, Spanned<Block>)
A function literal (function() ... end
).
An associated scope is for the function body.
Table(Table)
{1, 2, 3}
.
Var(Spanned<NameRef>)
A variable reference.
Exp(Spanned<Exp>)
Another expression.
This is primarily used to keep parentheses,
so that (3)
is composed of two expression nodes with two different spans.
FuncCall(Spanned<Exp>, Spanned<Args>)
f()
or f.g()
(the latter will have an Ex::IndexName
node).
MethodCall(Spanned<(Spanned<Exp>, Spanned<Name>)>, Spanned<Args>)
f:g()
or f.g:h()
(the latter will have an Ex::IndexName
node).
A span for the entire f:g
or f.g:h
part is separately recorded for autocompletion.
Index(Spanned<Exp>, Spanned<Exp>)
exp[exp]
.
IndexName(Spanned<Exp>, Spanned<Name>)
exp.name
. Distinguished from Ex::Index
for the purpose of IDE support.
Un(Spanned<UnOp>, Spanned<Exp>)
unop exp
.
Bin(Spanned<Exp>, Spanned<BinOp>, Spanned<Exp>)
exp binop exp
.
Trait Implementations
impl Clone for Ex
[src]
fn clone(&self) -> Ex
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for Ex
[src]
fn eq(&self, __arg_0: &Ex) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Ex) -> bool
This method tests for !=
.