Enum databind::Token[][src]

pub enum Token {
Show 43 variants Var, Objective, SetObjective, TestVar, GetVar, DefineFunc, FuncName(String), EndFunc, Tag, TagName(String), CallFunc, IfStatement, IfCondition(String), IfContents(String), ElseStatement, EndIf, WhileLoop, WhileCondition(String), WhileContents(String), EndWhileLoop, ModVarName(String), TestVarName(String), DelVarName(String), OpVarName(String), ObjectiveName(String), ObjectiveType(String), DeleteVar, Target(String), InitialSet, VarSet, VarAdd, VarSub, Int(i32), DefineMacro, CallMacro, MacroName(Stringusizeusize), MacroContents(String), EndMacro, DefArgList(Vec<String>), CallArgList(Vec<String>), NonDatabind(String), NewLine, None,
}
Expand description

The enum of Databind tokens used for tokenization of Databind source files

Variants

Var

Used before a mention of a variable (Token::VarName)

Objective

Used before an objective definition

SetObjective

Used before an objective modification

TestVar

Used before a variable (Token::VarName) to test

GetVar

Used before a variable (Token::VarName) to get. Meant for scoreboard operations (sbop)

DefineFunc

Define a function

FuncName(String)

The name of a function

Tuple Fields of FuncName

0: String
EndFunc

End a function definition

Tag

Add a tag to a function

TagName(String)

The name of a tag

Tuple Fields of TagName

0: String
CallFunc

Call a funcition

IfStatement

Start an if statement

IfCondition(String)

The condition for an if statement

Tuple Fields of IfCondition

0: String
IfContents(String)

The contents of an if or else statement

Tuple Fields of IfContents

0: String
ElseStatement

An else statement if the if statement condition was not true

EndIf

Close an if statement

WhileLoop

Start a while loop

WhileCondition(String)

The condition for a while loop

Tuple Fields of WhileCondition

0: String
WhileContents(String)

The string contents of a while loop

Tuple Fields of WhileContents

0: String
EndWhileLoop

Close a while loop

ModVarName(String)

A variable’s name for modifying

Tuple Fields of ModVarName

0: String
TestVarName(String)

A variable’s name for testing

Tuple Fields of TestVarName

0: String
DelVarName(String)

A variable’s name for deleting

Tuple Fields of DelVarName

0: String
OpVarName(String)

A variable’s name for scoreboard operations

Tuple Fields of OpVarName

0: String
ObjectiveName(String)

An objective’s name

Tuple Fields of ObjectiveName

0: String
ObjectiveType(String)

An objective’s type (eg. deathCount)

Tuple Fields of ObjectiveType

0: String
DeleteVar

Delete a variable or objective

Target(String)

A targeted entity (eg. Username or @a)

Tuple Fields of Target

0: String
InitialSet

Set the initial value of a variable

VarSet

Set the value of a variable or objective

VarAdd

Add to the value of a variable or objective

VarSub

Subtract from the value of a variable or objective

Int(i32)

An integer

Tuple Fields of Int

0: i32
DefineMacro

Define a Databind macro

CallMacro

Call a Databind macro

MacroName(Stringusizeusize)

The name of a Databind macro

The first usize is for the line with the macro name, and the second is for the column

Tuple Fields of MacroName

0: String1: usize2: usize
MacroContents(String)

The contents of a macro

Tuple Fields of MacroContents

0: String
EndMacro

Close a Databind macro definition

DefArgList(Vec<String>)

A list of either argument names for a macro definition

Tuple Fields of DefArgList

0: Vec<String>
CallArgList(Vec<String>)

A list of argument values for a macro call

Tuple Fields of CallArgList

0: Vec<String>
NonDatabind(String)

Commands, etc. that are not by databind

In the command execute if :tvar variable #etc execute if would be tokenized as NonDatabind.

Tuple Fields of NonDatabind

0: String
NewLine

A new line

None

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)

recently added

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.