Struct glsl_lang_lexer::ParseContextData
source · pub struct ParseContextData { /* private fields */ }
Expand description
Parsing context data
Implementations§
source§impl ParseContextData
impl ParseContextData
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new ParseContextData object
sourcepub fn with_policy(policy: impl TypeTablePolicy + 'static) -> Self
pub fn with_policy(policy: impl TypeTablePolicy + 'static) -> Self
Create a new ParseContextData object with the given type table policy
Parameters
policy
: policy object managing the type table
sourcepub fn with_comments() -> Self
pub fn with_comments() -> Self
Create a new ParseContextData object with comments parsing enabled
sourcepub fn with_comments_and_policy(policy: impl TypeTablePolicy + 'static) -> Self
pub fn with_comments_and_policy(policy: impl TypeTablePolicy + 'static) -> Self
Create a new ParseContextData object with comments parsing enabled and the given type table policy
Parameters
policy
: policy object managing the type table
sourcepub fn comments(&self) -> Option<&CommentList>
pub fn comments(&self) -> Option<&CommentList>
Get the list of comments stored in this parse context
source§impl ParseContextData
impl ParseContextData
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(&mut self, name: Identifier) -> TypeName
pub fn add_type_name(&mut self, name: Identifier) -> TypeName
Register name
as a new type name
sourcepub fn push_scope(&mut self)
pub fn push_scope(&mut self)
Enter a new nesting level for declarations
sourcepub fn new_identifier(&mut self, name: &Identifier, ctx: IdentifierContext)
pub fn new_identifier(&mut self, name: &Identifier, ctx: IdentifierContext)
Update the context data with a new identifier in a given context
source§impl ParseContextData
impl ParseContextData
sourcepub fn add_comment(&mut self, comment: Comment)
pub fn add_comment(&mut self, comment: Comment)
Add a new comment to the parsed comments list
Trait Implementations§
source§impl Clone for ParseContextData
impl Clone for ParseContextData
source§fn clone(&self) -> ParseContextData
fn clone(&self) -> ParseContextData
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ParseContextData
impl Debug for ParseContextData
source§impl Default for ParseContextData
impl Default for ParseContextData
source§impl From<ParseContextData> for ParseContext
impl From<ParseContextData> for ParseContext
source§fn from(data: ParseContextData) -> Self
fn from(data: ParseContextData) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for ParseContextData
impl !Send for ParseContextData
impl !Sync for ParseContextData
impl Unpin for ParseContextData
impl !UnwindSafe for ParseContextData
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more