Enum badlang_parser::Token

source ·
pub enum Token {
Show 37 variants StackValue(StackValue), Add, Subtract, Multiply, Divide, Dup, Drop, Swap, Over, Rot, Print, Println, If(usize), Elif(usize), Else(usize), MrBeast(usize), Eq, Seq, Sseq, Ineq, Sineq, Ssineq, Gt, Lt, Ge, Gse, Gsse, Le, Lse, Lsse, Shr, Shl, Or, And, Not, Xor, Dummy,
}

Variants§

§

StackValue(StackValue)

Just a fucking n̶u̶m̶b̶e̶r̶ value✨

§

Add

Addition. Often used to add numbers.

§

Subtract

Subtraction. Nothin’ more, Nothin’ less.

§

Multiply

Multiplication. Very similar to multiplication.

§

Divide

Division. Quoted in famous works such as “Math”.

§

Dup

Used to duplicate things, much like mitosis. a – a a

§

Drop

Drops the thing, much like I drop depth charges at 55°16’06.9“S 13°06’37.3“W (for legal reasons, this is a joke). a –

§

Swap

Swaps the two things, much like the process of nurses swapping babies in hospitals. a b – b a

§

Over

Lets the thing jump over. No good jokes here. a b – a b a

§

Rot

Rotates three things, much like my testicles. a b c – b c a

§

Print

Prints da thang, no matter what it is (least racist keyword). a –

§

Println

Very similar to print, but with that sweet ln

§

If(usize)

if-condition, often used by white people. The u32 is an offset to jump to.

§

Elif(usize)

elif is like an elif,

§

Else(usize)

else-condition exists but is non-existent in tokens because

§

MrBeast(usize)

fi also exists, but non-existent in tokens because MrBeast! is a mixture between fi and elif: Once it is reached, one of the if/(el)ifs has already executed, meaning it will jump to fi.

§

Eq

Equality, much like the thing globally not yet reached.

§

Seq

Strict equality, similar to javascripts strict equality thing.

§

Sseq

Even stricter equality, stricter than javascripts triple equal.

§

Ineq

Inequality,

§

Sineq

Strict inequality, similar to javascripts strict inequality thing.

§

Ssineq

Even stricter inequality, stricter than javascripts double inequal.

§

Gt

Greater-than,

§

Lt

Less-than,

§

Ge

Greater-than or equal,

§

Gse

Greater-than or strict equal,

§

Gsse

Greater-than or stricterer equal,

§

Le

Less-than or equal,

§

Lse

Less-than or strict equal,

§

Lsse

Less-than or strict strict equal,

§

Shr

Shift right,

§

Shl

Shift left,

§

Or

Or, both bool and integer

§

And

And, both bool and integer

§

Not

Not, both bool and integer

§

Xor

Xor, both bool and integer

§

Dummy

Does absolutely nothing, much like this programming language.

Trait Implementations§

source§

impl Clone for Token

source§

fn clone(&self) -> Token

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Token

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl EnumCount for Token

source§

const COUNT: usize = 37usize

source§

impl PartialEq for Token

source§

fn eq(&self, other: &Token) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Token

Auto Trait Implementations§

§

impl Freeze for Token

§

impl RefUnwindSafe for Token

§

impl Send for Token

§

impl Sync for Token

§

impl Unpin for Token

§

impl UnwindSafe for Token

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.