Skip to main content

TokenKind

Enum TokenKind 

Source
pub enum TokenKind {
Show 48 variants Ident(String), Const, Input, Extern, Shared, Volatile, Cursor, Over, Pragma, For(String), Tile, TileBody(String, TileBodyKind), Dot, IntLit(u64), FloatLit(f64), StringLit(String), ColonEq, Eq, LParen, RParen, LBracket, RBracket, LBrace, RBrace, Comma, Colon, Arrow, Plus, Minus, Star, Slash, Percent, Caret, StarStar, ShiftLeft, ShiftRight, Ampersand, AmpAmp, Pipe, PipePipe, Bang, Lt, Gt, EqEq, BangEq, LtEq, GtEq, Eof,
}
Expand description

The kinds of token the lexer produces.

Variants§

§

Ident(String)

A bare identifier: cycle, hash, temp_lut

§

Const

const keyword — declares an effectively-const binding. Replaces the former final / init distinction; both surfaces collapsed into one. The value is materialized at the earliest opportunity (compile-time fold if possible, scope-init pull otherwise) and is then immutable for the scope’s lifetime. Independent of provenance: a const binding’s RHS may reference workload params, iter-vars bound by an enclosing comprehension, or other in-scope names — whatever the Polydat compiler can resolve.

§

Input

input keyword — declares one per-cycle kernel input slot. Surface: input <name>[: <type>] (single) or input (<name>[: <type>], ...) (tuple sugar). Mirrors the module-signature param-list shape.

§

Extern

extern keyword

§

Shared

shared keyword

§

Volatile

volatile keyword (SRD-44 + design memo resumable_test_fixture.md). Wire-coloring modifier excluding the binding’s value from hash_const.

§

Cursor

cursor keyword

§

Over

over keyword — SRD 71 partition-source binding on cursor declarations: cursor q = range(0, N) over p. Soft keyword: only recognised at statement level after a cursor decl’s constructor expression; in expression position it’s a plain identifier.

§

Pragma

pragma keyword (module-level directive opening, SRD 15 §“Module-Level Pragmas”). Followed by an Ident naming the pragma. Distinct from line comments so the parser sees pragmas as first-class statements rather than scraping them out of // @pragma: text.

§

For(String)

for followed by its raw comprehension text (SRD 113). The lexer captures everything after the keyword up to a { at nesting depth zero or the end of the line, whichever comes first, so the comprehension grammar stays owned by the comprehension parser rather than being re-tokenized here.

§

Tile

tile keyword (SRD 114). The body after := is captured raw into a TokenKind::TileBody when it is a block or heredoc.

§

TileBody(String, TileBodyKind)

A raw tile body and how it was written.

§

Dot

. (field access: base.ordinal)

§

IntLit(u64)

Integer literal: 1000, 0xFF

§

FloatLit(f64)

Float literal: 72.0, 3.14

§

StringLit(String)

String literal (contents only, no quotes): "hello {name}"

§

ColonEq

:= (binding operator, used by every binding shape: cycle bindings, const, shared, volatile)

§

Eq

= (reserved for future use in expression-level comparisons; not currently emitted by any binding form)

§

LParen

(

§

RParen

)

§

LBracket

[

§

RBracket

]

§

LBrace

{

§

RBrace

}

§

Comma

,

§

Colon

:

§

Arrow

->

§

Plus

+

§

Minus

- (both binary subtract and unary negate)

§

Star

*

§

Slash

/

§

Percent

%

§

Caret

^ (bitwise XOR)

§

StarStar

** (power)

§

ShiftLeft

<< (shift left)

§

ShiftRight

>> (shift right)

§

Ampersand

& (bitwise AND)

§

AmpAmp

&& (logical AND — SRD-84 Part 1)

§

Pipe

| (bitwise OR)

§

PipePipe

|| (logical OR — SRD-84 Part 1)

§

Bang

! (unary bitwise NOT)

§

Lt

< (less-than comparison)

§

Gt

> (greater-than comparison)

§

EqEq

== (equal-to comparison)

§

BangEq

!= (not-equal-to comparison)

§

LtEq

<= (less-than-or-equal comparison)

§

GtEq

>= (greater-than-or-equal comparison)

§

Eof

End of input

Trait Implementations§

Source§

impl Clone for TokenKind

Source§

fn clone(&self) -> TokenKind

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 Debug for TokenKind

Source§

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

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

impl PartialEq for TokenKind

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TokenKind

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.