Skip to main content

SyntaxKind

Enum SyntaxKind 

Source
pub enum SyntaxKind {
Show 113 variants WHITESPACE = 0, COMMENT, NEWLINE, INDENT, DEDENT, IDENT, VAR, ANNOTATION, STRING, NUMBER, L_PAREN, R_PAREN, L_BRACK, R_BRACK, L_BRACE, R_BRACE, COMMA, COLON, DOT, QUESTION, PIPE, BANG, EQ, PLUS, MINUS, STAR, SLASH, LT, GT, ARROW, PLUS_EQ, EQ_EQ, NEQ, LT_EQ, GT_EQ, AMP_AMP, PIPE_PIPE, ERROR, EOF, ROOT, FLOW_DECL, FLOW_HEADER, OP_DECL, OP_HEADER, OP_META, PARAM_LIST, PARAM, DECL, DECL_HEADER, DECL_ATTR, BLOCK, BIND_STMT, CALL_STMT, WHEN_STMT, ELSE_CLAUSE, UNLESS_STMT, EACH_STMT, REPEAT_STMT, UNTIL_CLAUSE, MATCH_STMT, CASE_ARM, DEFAULT_ARM, ROUTE_STMT, FALLBACK_STMT, BRANCH_ARM, PARALLEL_STMT, LOOP_STMT, TIMEOUT_STMT, BUDGET_STMT, WITH_TOOLS_STMT, RETRY_STMT, SEQ_STMT, CTX_STMT, CTX_APPEND_STMT, RETURN_STMT, ASSERT_STMT, EFFECT_ANNOT, JSON_ESCAPE, MEMO_STMT, ONCE_STMT, CHECKPOINT_STMT, AWAIT_STMT, CONFIRM_STMT, THROTTLE_STMT, DEBOUNCE_STMT, VERIFY_STMT, TRY_STMT, CATCH_CLAUSE, RACE_STMT, SCOPE_STMT, FINALLY_CLAUSE, SAGA_STMT, STEP_ARM, UNDO_CLAUSE, PIPE_STMT, CALL_EXPR, VAR_EXPR, FIELD_EXPR, LIT_EXPR, FMT_EXPR, PARSE_EXPR, PEEK_EXPR, THING_EXPR, JSON_EXPR, OBJ_EXPR, OBJ_FIELD, LIST_EXPR, BIN_EXPR, UNARY_EXPR, PAREN_EXPR, ARG_LIST, NAME, CTX_ENTRY, // some variants omitted
}
Expand description

Every token and node kind in the Flux-Lang CST.

#[repr(u16)] with contiguous discriminants (no gaps) so FluxLang can round-trip a kind through rowan’s u16 by a checked transmute. Keep SyntaxKind::__LAST the final variant.

Variants§

§

WHITESPACE = 0

A run of spaces/tabs within or leading a line.

§

COMMENT

A # … line comment (up to, but not including, the line break).

§

NEWLINE

A line break (\n or \r\n).

§

INDENT

Emitted before the first token of a line indented deeper than the enclosing block.

§

DEDENT

Emitted before the first token of a line dedented out of a block (one per level closed).

§

IDENT

An identifier run [A-Za-z_][A-Za-z0-9_]* — also every (contextual) keyword; the parser classifies keywords, the lexer does not.

§

VAR

A $symbol reference.

§

ANNOTATION

An @annotation (e.g. @effect, @json).

§

STRING

A "…" or """…""" string literal (one token, delimiters included).

§

NUMBER

A numeric literal [0-9][0-9_]*(\.[0-9]+)?.

§

L_PAREN

§

R_PAREN

§

L_BRACK

§

R_BRACK

§

L_BRACE

§

R_BRACE

§

COMMA

§

COLON

§

DOT

§

QUESTION

§

PIPE

§

BANG

§

EQ

§

PLUS

§

MINUS

§

STAR

§

SLASH

§

LT

§

GT

§

ARROW

§

PLUS_EQ

§

EQ_EQ

§

NEQ

§

LT_EQ

§

GT_EQ

§

AMP_AMP

§

PIPE_PIPE

§

ERROR

One or more bytes the lexer could not classify (kept, so the tree stays lossless).

§

EOF

End of input (never materialized into the tree; a parser convenience).

§

ROOT

The document root: a whole .flux module.

§

FLOW_DECL

A single top-level flow declaration (the common case) or the module wrapper.

§

FLOW_HEADER

The flow [name]([params]) [-> type] header line.

§

OP_DECL

A top-level composite operation declaration.

§

OP_HEADER

The op name(params) [-> type] header line.

§

OP_META

One leading composite-op metadata line (description, risk, effects, …).

§

PARAM_LIST

The parenthesized parameter list of a flow header.

§

PARAM

One name: Type parameter.

§

DECL

A pure-data top-level declaration the L6 host interprets (agent/channel/datasource/ trigger/journey).

§

DECL_HEADER

The first line of a pure-data declaration.

§

DECL_ATTR

One key value line inside a pure-data declaration.

§

BLOCK

An indented block of statements (a flow/clause body).

§

BIND_STMT

§

CALL_STMT

§

WHEN_STMT

§

ELSE_CLAUSE

§

UNLESS_STMT

§

EACH_STMT

§

REPEAT_STMT

§

UNTIL_CLAUSE

§

MATCH_STMT

§

CASE_ARM

§

DEFAULT_ARM

§

ROUTE_STMT

§

FALLBACK_STMT

§

BRANCH_ARM

§

PARALLEL_STMT

§

LOOP_STMT

§

TIMEOUT_STMT

§

BUDGET_STMT

§

WITH_TOOLS_STMT

§

RETRY_STMT

§

SEQ_STMT

§

CTX_STMT

§

CTX_APPEND_STMT

§

RETURN_STMT

§

ASSERT_STMT

§

EFFECT_ANNOT

§

JSON_ESCAPE

§

MEMO_STMT

§

ONCE_STMT

§

CHECKPOINT_STMT

§

AWAIT_STMT

§

CONFIRM_STMT

§

THROTTLE_STMT

§

DEBOUNCE_STMT

§

VERIFY_STMT

§

TRY_STMT

§

CATCH_CLAUSE

§

RACE_STMT

§

SCOPE_STMT

§

FINALLY_CLAUSE

§

SAGA_STMT

§

STEP_ARM

§

UNDO_CLAUSE

§

PIPE_STMT

§

CALL_EXPR

§

VAR_EXPR

§

FIELD_EXPR

§

LIT_EXPR

§

FMT_EXPR

§

PARSE_EXPR

§

PEEK_EXPR

§

THING_EXPR

§

JSON_EXPR

§

OBJ_EXPR

§

OBJ_FIELD

§

LIST_EXPR

§

BIN_EXPR

§

UNARY_EXPR

§

PAREN_EXPR

§

ARG_LIST

§

NAME

§

CTX_ENTRY

One purpose/include/exclude/budget sub-line inside a ctx block. Its ownership is structural; semantic lowering decodes the scalar header fields from its leaf tokens.

Implementations§

Source§

impl SyntaxKind

Source

pub fn is_trivia(self) -> bool

Trivia is text the parser attaches to the tree but never branches on.

Source

pub fn is_layout(self) -> bool

The zero-width layout markers that carry the indentation grammar.

Trait Implementations§

Source§

impl Clone for SyntaxKind

Source§

fn clone(&self) -> SyntaxKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for SyntaxKind

Source§

impl Debug for SyntaxKind

Source§

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

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

impl Eq for SyntaxKind

Source§

impl Hash for SyntaxKind

Source§

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

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 (const: unstable) · Source§

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

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

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

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

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

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

impl PartialEq for SyntaxKind

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
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 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
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<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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> Same for T

Source§

type Output = T

Should always be Self
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.