Enum Scope

Source
pub enum Scope {
Show 29 variants Comment, ConstantNumber, ConstantChar, ConstantLanguage, ConstantOther, NameFunction, NameType, NameTag, NameSection, Invalid, Deprecated, StorageType, StorageModifier, StringQuoted, StringEvaluated, StringRegex, StringOther, SupportFunction, SupportType, SupportConstant, SupportVar, SupportOther, VariableParameter, VariableLanguage, VariableOther, KeywordControl, KeywordOperator, KeywordOther, None,
}
Expand description

The scope of a token.

Variants§

§

Comment

A comment token, such as:

// Hello, world!
/* Hello, world! */
<!-- Hello, world! -->
§

ConstantNumber

A numeric constant token.

1234;
1.3f32;
0x42;
§

ConstantChar

A character constant token.

'A';
§

ConstantLanguage

A language constant token.

true;
false;
nullptr
nil
§

ConstantOther

Any other constant.

§

NameFunction

A function name token.

main();
§

NameType

A type name token.

typedef struct Name {
    int member;
} Name;
§

NameTag

The name of a tag.

<name></name>
§

NameSection

The name of a tag.

## Header
\chapter{Chapter}
§

Invalid

An invalid token.

§

Deprecated

A deprecated case.

§

StorageType

A storage type keyword, such as class, function or var.

class MyClass {
public:
    // ...
}
fn main() {
    println!("Hello, world!");
}
§

StorageModifier

A storage modifier keyword, such as static, mut, final, etc.

§

StringQuoted

A quoted string token.

§

StringEvaluated

A string that is evaluated, such as JavaScript template strings.

§

StringRegex

A regex string.

/([a-zA-Z])+/g
§

StringOther

Any other kind of string.

§

SupportFunction

A function provided by the language or standard library.

§

SupportType

A type (class, struct, etc.) provided by the language or standard library.

§

SupportConstant

A constant provided by the language or standard library.

§

SupportVar

A variable provided by the language or standard library.

§

SupportOther

Any other supporting value.

§

VariableParameter

A variable declared as a function parameter.

§

VariableLanguage

A special variable such as super or this.

§

VariableOther

Any other variable names.

§

KeywordControl

A controlling keyword, such as if, break, return, while, etc.

§

KeywordOperator

An operator keyword, such as instanceof, as, instance, or, etc.

§

KeywordOther

An other keyword.

§

None

No scope matches this token.

Implementations§

Source§

impl Scope

Source

pub fn snake_case(&self) -> &str

Converts the Scope’s name to a snake case string.

Source

pub fn kebab_case(&self) -> &str

Converts the Scope’s name to a kebab case string.

Trait Implementations§

Source§

impl Clone for Scope

Source§

fn clone(&self) -> Scope

Returns a duplicate 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 Scope

Source§

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

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

impl PartialEq for Scope

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Scope

Source§

impl StructuralPartialEq for Scope

Auto Trait Implementations§

§

impl Freeze for Scope

§

impl RefUnwindSafe for Scope

§

impl Send for Scope

§

impl Sync for Scope

§

impl Unpin for Scope

§

impl UnwindSafe for Scope

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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>,

Source§

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>,

Source§

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.