Struct glsl_lang::parse::ParseContext
source · [−]pub struct ParseContext { /* private fields */ }
Expand description
Parsing context
Implementations
sourceimpl ParseContext
impl ParseContext
sourcepub fn new() -> ParseContext
pub fn new() -> ParseContext
Create a new parsing context from this options object
sourcepub fn new_with_comments() -> ParseContext
pub fn new_with_comments() -> ParseContext
Create a new parsing context from this options object, with comment parsing enabled
sourcepub fn new_with_policy(policy: impl TypeTablePolicy + 'static) -> ParseContext
pub fn new_with_policy(policy: impl TypeTablePolicy + 'static) -> ParseContext
Create a new parsing context from this options object, with a custom type table policy
sourcepub fn new_with_comments_and_policy(
policy: impl TypeTablePolicy + 'static
) -> ParseContext
pub fn new_with_comments_and_policy(
policy: impl TypeTablePolicy + 'static
) -> ParseContext
Create a new parsing context from this options object, with a custom type table policy and comment parsing enabled
sourcepub fn new_with_context(context: ParseContextData) -> ParseContext
pub fn new_with_context(context: ParseContextData) -> ParseContext
Create a new parsing context from this options object and pre-existing context data
sourcepub fn clone_inner(&self) -> ParseContext
pub fn clone_inner(&self) -> ParseContext
Clone the parsing data and return the cloned context
sourcepub fn into_data(self) -> Option<ParseContextData>
pub fn into_data(self) -> Option<ParseContextData>
Consume this ParseContext and return its data. Will fail if there are multiple references to this context’s data.
sourcepub fn data(&self) -> Ref<'_, ParseContextData>
pub fn data(&self) -> Ref<'_, ParseContextData>
Obtain a reference to the context’s data
sourcepub fn data_mut(&self) -> RefMut<'_, ParseContextData>
pub fn data_mut(&self) -> RefMut<'_, ParseContextData>
Obtain an exclusive reference to the context’s data
sourcepub fn with_policy(
&self,
policy: impl TypeTablePolicy + 'static
) -> ParseContext
pub fn with_policy(
&self,
policy: impl TypeTablePolicy + 'static
) -> ParseContext
Create a new parse context cloning the given one’s data, but applies the given policy
sourceimpl ParseContext
impl ParseContext
sourcepub fn is_type_name(&self, name: &str) -> bool
pub fn is_type_name(&self, name: &str) -> bool
Return true
if the given name is a type name
sourcepub fn add_type_name(&self, name: Node<IdentifierData>) -> Node<TypeNameData>
pub fn add_type_name(&self, name: Node<IdentifierData>) -> Node<TypeNameData>
Register name
as a new type name
sourcepub fn push_scope(&self)
pub fn push_scope(&self)
Enter a new nesting level for declarations
sourcepub fn new_identifier(
&self,
name: &Node<IdentifierData>,
ctx: IdentifierContext
)
pub fn new_identifier(
&self,
name: &Node<IdentifierData>,
ctx: IdentifierContext
)
Update the context data with a new identifier in a given context
sourceimpl ParseContext
impl ParseContext
sourcepub fn has_comments(&self) -> bool
pub fn has_comments(&self) -> bool
Return true
if this parsing context supports comments
sourcepub fn add_comment(&self, comment: Node<CommentData>)
pub fn add_comment(&self, comment: Node<CommentData>)
Add a new comment to the parsed comments list
Trait Implementations
sourceimpl Clone for ParseContext
impl Clone for ParseContext
sourcefn clone(&self) -> ParseContext
fn clone(&self) -> ParseContext
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ParseContext
impl Debug for ParseContext
sourceimpl Default for ParseContext
impl Default for ParseContext
sourcefn default() -> ParseContext
fn default() -> ParseContext
Returns the “default value” for a type. Read more
sourceimpl From<ParseContextData> for ParseContext
impl From<ParseContextData> for ParseContext
sourcefn from(data: ParseContextData) -> ParseContext
fn from(data: ParseContextData) -> ParseContext
Converts to this type from the input type.
sourceimpl PartialEq<ParseContext> for ParseContext
impl PartialEq<ParseContext> for ParseContext
sourcefn eq(&self, other: &ParseContext) -> bool
fn eq(&self, other: &ParseContext) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ParseContext) -> bool
fn ne(&self, other: &ParseContext) -> bool
This method tests for !=
.
impl StructuralPartialEq for ParseContext
Auto Trait Implementations
impl !RefUnwindSafe for ParseContext
impl !Send for ParseContext
impl !Sync for ParseContext
impl Unpin for ParseContext
impl !UnwindSafe for ParseContext
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more