Enum oq3_syntax::SyntaxKind

source ·
#[repr(u16)]
pub enum SyntaxKind {
Show 200 variants DOUBLE_PLUS, SEMICOLON, COMMA, L_PAREN, R_PAREN, L_CURLY, R_CURLY, L_BRACK, R_BRACK, L_ANGLE, R_ANGLE, AT, POUND, TILDE, QUESTION, DOLLAR, AMP, PIPE, PLUS, STAR, SLASH, CARET, PERCENT, UNDERSCORE, DOT, DOT2, DOT3, DOT2EQ, COLON, COLON2, EQ, EQ2, FAT_ARROW, BANG, NEQ, MINUS, THIN_ARROW, LTEQ, GTEQ, PLUSEQ, MINUSEQ, PIPEEQ, AMPEQ, CARETEQ, SLASHEQ, STAREQ, PERCENTEQ, AMP2, PIPE2, SHL, SHR, SHLEQ, SHREQ, O_P_E_N_Q_A_S_M_KW, INCLUDE_KW, PRAGMA_KW, DEF_KW, DEFCALGRAMMAR_KW, CAL_KW, DEFCAL_KW, GATE_KW, DELAY_KW, RESET_KW, MEASURE_KW, LET_KW, BOX_KW, EXTERN_KW, CONST_KW, BARRIER_KW, GPHASE_KW, IF_KW, ELSE_KW, FOR_KW, IN_KW, WHILE_KW, CONTINUE_KW, RETURN_KW, BREAK_KW, END_KW, SWITCH_KW, CASE_KW, DEFAULT_KW, INPUT_KW, OUTPUT_KW, READONLY_KW, MUTABLE_KW, QREG_KW, CREG_KW, QUBIT_KW, VOID_KW, ARRAY_KW, CTRL_KW, NEGCTRL_KW, INV_KW, POW_KW, FALSE_KW, TRUE_KW, INT_NUMBER, FLOAT_NUMBER, CHAR, BYTE, STRING, BIT_STRING, FLOAT_TY, INT_TY, UINT_TY, COMPLEX_TY, BOOL_TY, BIT_TY, DURATION_TY, STRETCH_TY, ANGLE_TY, ERROR, IDENT, HARDWAREIDENT, WHITESPACE, COMMENT, PRAGMA, ANNOTATION, SOURCE_FILE, GATE, DEF_CAL, DELAY_STMT, CAL, DEF_CAL_GRAMMAR, MEASURE, BARRIER, DEF, RESET, CONST, PRAGMA_STATEMENT, ANNOTATION_STATEMENT, TIMING_LITERAL, TUPLE_EXPR, ARRAY_EXPR, PAREN_EXPR, IF_STMT, WHILE_STMT, FOR_STMT, FOR_ITERABLE, END_STMT, CONTINUE_STMT, BREAK_STMT, BLOCK_EXPR, STMT_LIST, RETURN_EXPR, LET_STMT, BOX_EXPR, SWITCH_CASE_STMT, CASE_EXPR, CALL_EXPR, GATE_CALL_EXPR, MODIFIED_GATE_CALL_EXPR, G_PHASE_CALL_EXPR, CAST_EXPRESSION, INDEX_EXPR, PREFIX_EXPR, RANGE_EXPR, BIN_EXPR, LITERAL, NAME, EXPR_STMT, TYPE, PARAM_LIST, TYPED_PARAM_LIST, QUBIT_LIST, FILE_PATH, PARAM, TYPED_PARAM, ARG_LIST, VERSION, VERSION_STRING, INCLUDE, DECLARATION, DESIGNATOR, SCALAR_TYPE, ARRAY_TYPE, QUBIT_TYPE, EXPRESSION_LIST, RETURN_SIGNATURE, SET_EXPRESSION, ALIAS_DECLARATION_STATEMENT, INDEX_OPERATOR, INDEX_KIND, INDEXED_IDENTIFIER, IDENTIFIER, ARRAY_LITERAL, HARDWARE_QUBIT, CLASSICAL_DECLARATION_STATEMENT, ASSIGNMENT_STMT, I_O_DECLARATION_STATEMENT, GATE_OPERAND, MEASURE_EXPRESSION, OLD_STYLE_DECLARATION_STATEMENT, QUANTUM_DECLARATION_STATEMENT, INV_MODIFIER, POW_MODIFIER, CTRL_MODIFIER, NEG_CTRL_MODIFIER, MODIFIER, // some variants omitted
}
Expand description

The kind of syntax node, e.g. IDENT, USE_KW, or STRUCT.

Variants§

§

DOUBLE_PLUS

punctuation

§

SEMICOLON

§

COMMA

§

L_PAREN

§

R_PAREN

§

L_CURLY

§

R_CURLY

§

L_BRACK

§

R_BRACK

§

L_ANGLE

§

R_ANGLE

§

AT

§

POUND

§

TILDE

§

QUESTION

§

DOLLAR

§

AMP

§

PIPE

§

PLUS

§

STAR

§

SLASH

§

CARET

§

PERCENT

§

UNDERSCORE

§

DOT

§

DOT2

§

DOT3

§

DOT2EQ

§

COLON

§

COLON2

§

EQ

§

EQ2

§

FAT_ARROW

§

BANG

§

NEQ

§

MINUS

§

THIN_ARROW

§

LTEQ

§

GTEQ

§

PLUSEQ

§

MINUSEQ

§

PIPEEQ

§

AMPEQ

§

CARETEQ

§

SLASHEQ

§

STAREQ

§

PERCENTEQ

§

AMP2

§

PIPE2

§

SHL

§

SHR

§

SHLEQ

§

SHREQ

§

O_P_E_N_Q_A_S_M_KW

all_keywords

§

INCLUDE_KW

§

PRAGMA_KW

§

DEF_KW

§

DEFCALGRAMMAR_KW

§

CAL_KW

§

DEFCAL_KW

§

GATE_KW

§

DELAY_KW

§

RESET_KW

§

MEASURE_KW

§

LET_KW

§

BOX_KW

§

EXTERN_KW

§

CONST_KW

§

BARRIER_KW

§

GPHASE_KW

§

IF_KW

§

ELSE_KW

§

FOR_KW

§

IN_KW

§

WHILE_KW

§

CONTINUE_KW

§

RETURN_KW

§

BREAK_KW

§

END_KW

§

SWITCH_KW

§

CASE_KW

§

DEFAULT_KW

§

INPUT_KW

§

OUTPUT_KW

§

READONLY_KW

§

MUTABLE_KW

§

QREG_KW

§

CREG_KW

§

QUBIT_KW

§

VOID_KW

§

ARRAY_KW

§

CTRL_KW

§

NEGCTRL_KW

§

INV_KW

§

POW_KW

§

FALSE_KW

§

TRUE_KW

§

INT_NUMBER

literals

§

FLOAT_NUMBER

§

CHAR

§

BYTE

§

STRING

§

BIT_STRING

§

FLOAT_TY

scalar_types

§

INT_TY

§

UINT_TY

§

COMPLEX_TY

§

BOOL_TY

§

BIT_TY

§

DURATION_TY

§

STRETCH_TY

§

ANGLE_TY

§

ERROR

tokens

§

IDENT

§

HARDWAREIDENT

§

WHITESPACE

§

COMMENT

§

PRAGMA

§

ANNOTATION

§

SOURCE_FILE

nodes

§

GATE

§

DEF_CAL

§

DELAY_STMT

§

CAL

§

DEF_CAL_GRAMMAR

§

MEASURE

§

BARRIER

§

DEF

§

RESET

§

CONST

§

PRAGMA_STATEMENT

§

ANNOTATION_STATEMENT

§

TIMING_LITERAL

§

TUPLE_EXPR

§

ARRAY_EXPR

§

PAREN_EXPR

§

IF_STMT

§

WHILE_STMT

§

FOR_STMT

§

FOR_ITERABLE

§

END_STMT

§

CONTINUE_STMT

§

BREAK_STMT

§

BLOCK_EXPR

§

STMT_LIST

§

RETURN_EXPR

§

LET_STMT

§

BOX_EXPR

§

SWITCH_CASE_STMT

§

CASE_EXPR

§

CALL_EXPR

§

GATE_CALL_EXPR

§

MODIFIED_GATE_CALL_EXPR

§

G_PHASE_CALL_EXPR

§

CAST_EXPRESSION

§

INDEX_EXPR

§

PREFIX_EXPR

§

RANGE_EXPR

§

BIN_EXPR

§

LITERAL

§

NAME

§

EXPR_STMT

§

TYPE

§

PARAM_LIST

§

TYPED_PARAM_LIST

§

QUBIT_LIST

§

FILE_PATH

§

PARAM

§

TYPED_PARAM

§

ARG_LIST

§

VERSION

§

VERSION_STRING

§

INCLUDE

§

DECLARATION

§

DESIGNATOR

§

SCALAR_TYPE

§

ARRAY_TYPE

§

QUBIT_TYPE

§

EXPRESSION_LIST

§

RETURN_SIGNATURE

§

SET_EXPRESSION

§

ALIAS_DECLARATION_STATEMENT

§

INDEX_OPERATOR

§

INDEX_KIND

§

INDEXED_IDENTIFIER

§

IDENTIFIER

§

ARRAY_LITERAL

§

HARDWARE_QUBIT

§

CLASSICAL_DECLARATION_STATEMENT

§

ASSIGNMENT_STMT

§

I_O_DECLARATION_STATEMENT

§

GATE_OPERAND

§

MEASURE_EXPRESSION

§

OLD_STYLE_DECLARATION_STATEMENT

§

QUANTUM_DECLARATION_STATEMENT

§

INV_MODIFIER

§

POW_MODIFIER

§

CTRL_MODIFIER

§

NEG_CTRL_MODIFIER

§

MODIFIER

Implementations§

source§

impl SyntaxKind

source

pub fn is_classical_type(&self) -> bool

Return true if the next token begins a classical type, including array, specification.

source

pub fn is_quantum_type(&self) -> bool

Return true if the next token begins quantum type.

source

pub fn is_type(&self) -> bool

Return true if the next token begins a type.

source§

impl SyntaxKind

source

pub fn is_keyword(self) -> bool

source

pub fn is_punct(self) -> bool

source

pub fn is_literal(self) -> bool

source

pub fn is_scalar_type(self) -> bool

source

pub fn from_keyword(ident: &str) -> Option<SyntaxKind>

source

pub fn from_scalar_type(type_name: &str) -> Option<SyntaxKind>

source

pub fn from_char(c: char) -> Option<SyntaxKind>

source§

impl SyntaxKind

source

pub fn is_trivia(self) -> bool

Trait Implementations§

source§

impl Clone for SyntaxKind

source§

fn clone(&self) -> SyntaxKind

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 SyntaxKind

source§

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

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

impl From<u16> for SyntaxKind

source§

fn from(d: u16) -> SyntaxKind

Converts to this type from the input type.
source§

impl Hash for SyntaxKind

source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for SyntaxKind

source§

fn cmp(&self, other: &SyntaxKind) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for SyntaxKind

source§

fn eq(&self, other: &SyntaxKind) -> 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 PartialOrd for SyntaxKind

source§

fn partial_cmp(&self, other: &SyntaxKind) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for SyntaxKind

source§

impl Eq for SyntaxKind

source§

impl StructuralPartialEq for SyntaxKind

Auto Trait Implementations§

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> IntoBox<dyn Any> for T
where T: Any,

source§

fn into_box(self) -> Box<dyn Any>

Convert self into the appropriate boxed form.
source§

impl<T> IntoBox<dyn Any + Send> for T
where T: Any + Send,

source§

fn into_box(self) -> Box<dyn Any + Send>

Convert self into the appropriate boxed form.
source§

impl<T> IntoBox<dyn Any + Send + Sync> for T
where T: Any + Send + Sync,

source§

fn into_box(self) -> Box<dyn Any + Send + Sync>

Convert self into the appropriate boxed form.
source§

impl<T> IntoBox<dyn CloneAny> for T
where T: CloneAny,

source§

fn into_box(self) -> Box<dyn CloneAny>

Convert self into the appropriate boxed form.
source§

impl<T> IntoBox<dyn CloneAny + Send> for T
where T: CloneAny + Send,

source§

fn into_box(self) -> Box<dyn CloneAny + Send>

Convert self into the appropriate boxed form.
source§

impl<T> IntoBox<dyn CloneAny + Send + Sync> for T
where T: CloneAny + Send + Sync,

source§

fn into_box(self) -> Box<dyn CloneAny + Send + Sync>

Convert self into the appropriate boxed form.
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.
source§

impl<T> CloneAny for T
where T: Any + Clone,