Trait glsl_lang::parse::Parsable[][src]

pub trait Parsable: Sized {
    fn parse_with_options(
        source: &str,
        opts: &ParseContext
    ) -> Result<(Self, ParseContext), ParseError>; fn parse(source: &str) -> Result<Self, ParseError> { ... } }

A parsable is something we can parse either directly, or embedded in some other syntax structure.

This allows us to parse specific AST items even though we don’t export a LALR parser for it. Due to the way it is currently implemented, we have to generate extra code around the input, thus, if you are matching on span positions, you will get a different result than if using the parser directly.

Required methods

fn parse_with_options(
    source: &str,
    opts: &ParseContext
) -> Result<(Self, ParseContext), ParseError>
[src]

Parse the input source with the given options

Loading content...

Provided methods

fn parse(source: &str) -> Result<Self, ParseError>[src]

Parse the input source

Loading content...

Implementors

impl Parsable for ArraySpecifierDimension[src]

impl Parsable for AssignmentOp[src]

impl Parsable for CaseLabel[src]

impl Parsable for Expr[src]

impl Parsable for FunIdentifier[src]

impl Parsable for InterpolationQualifier[src]

impl Parsable for IterationStatement[src]

impl Parsable for JumpStatement[src]

impl Parsable for PrecisionQualifier[src]

impl Parsable for StorageQualifier[src]

impl Parsable for TypeSpecifierNonArray[src]

impl Parsable for UnaryOp[src]

impl Parsable for ArraySpecifier[src]

impl Parsable for ArrayedIdentifier[src]

impl Parsable for ExprStatement[src]

impl Parsable for FullySpecifiedType[src]

impl Parsable for LayoutQualifier[src]

impl Parsable for SelectionStatement[src]

impl Parsable for StructFieldSpecifier[src]

impl Parsable for StructSpecifier[src]

impl Parsable for SwitchStatement[src]

impl Parsable for TypeQualifier[src]

impl Parsable for TypeSpecifier[src]

impl Parsable for CompoundStatement[src]

impl Parsable for Declaration[src]

impl Parsable for FunctionDefinition[src]

impl Parsable for Preprocessor[src]

impl Parsable for Statement[src]

impl<T: Parse> Parsable for T[src]

Loading content...