Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/naga/src/front/glsl/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 2 kB image not shown  

Quelle  token.rs

  Sprache: Rust
 

pub use pp_rs::token::{Float, Integer, Location, Token as PPToken};

use super::ast::Precision;
use crate::{Interpolation, Sampling, Span, Type};

impl From<Location> for Span {
    fn from(loc: Location) -> Self {
        Span::new(loc.start, loc.end)
    }
}

#[derive(Debug)]
#[cfg_attr(test, derive(PartialEq))]
pub struct Token {
    pub value: TokenValue,
    pub meta: Span,
}

/// A token passed from the lexing used in the parsing.
///
/// This type is exported since it's returned in the
/// [`InvalidToken`](super::ErrorKind::InvalidToken) error.
#[derive(Clone, Debug, PartialEq)]
pub enum TokenValue {
    Identifier(String),

    FloatConstant(Float),
    IntConstant(Integer),
    BoolConstant(bool),

    Layout,
    In,
    Out,
    InOut,
    Uniform,
    Buffer,
    Const,
    Shared,

    Restrict,
    /// A `glsl` memory qualifier such as `writeonly`
    ///
    /// The associated [`crate::StorageAccess`] is the access being allowed
    /// (for example `writeonly` has an associated value of [`crate::StorageAccess::STORE`])
    MemoryQualifier(crate::StorageAccess),

    Invariant,
    Interpolation(Interpolation),
    Sampling(Sampling),
    Precision,
    PrecisionQualifier(Precision),

    Continue,
    Break,
    Return,
    Discard,

    If,
    Else,
    Switch,
    Case,
    Default,
    While,
    Do,
    For,

    Void,
    Struct,
    TypeName(Type),

    Assign,
    AddAssign,
    SubAssign,
    MulAssign,
    DivAssign,
    ModAssign,
    LeftShiftAssign,
    RightShiftAssign,
    AndAssign,
    XorAssign,
    OrAssign,

    Increment,
    Decrement,

    LogicalOr,
    LogicalAnd,
    LogicalXor,

    LessEqual,
    GreaterEqual,
    Equal,
    NotEqual,

    LeftShift,
    RightShift,

    LeftBrace,
    RightBrace,
    LeftParen,
    RightParen,
    LeftBracket,
    RightBracket,
    LeftAngle,
    RightAngle,

    Comma,
    Semicolon,
    Colon,
    Dot,
    Bang,
    Dash,
    Tilde,
    Plus,
    Star,
    Slash,
    Percent,
    VerticalBar,
    Caret,
    Ampersand,
    Question,
}

#[derive(Debug)]
#[cfg_attr(test, derive(PartialEq))]
pub struct Directive {
    pub kind: DirectiveKind,
    pub tokens: Vec<PPToken>,
}

#[derive(Debug)]
#[cfg_attr(test, derive(PartialEq))]
pub enum DirectiveKind {
    Version { is_first_directive: bool },
    Extension,
    Pragma,
}

Messung V0.5 in Prozent
C=82 H=93 G=87

¤ Dauer der Verarbeitung: 0.15 Sekunden  (vorverarbeitet am  2026-06-18) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.