Struct glsl_lang::parse::ParseContextData
source · pub struct ParseContextData {
names: Vec<HashSet<SmolStr>>,
comments: Option<BTreeMap<NodeSpan, Node<CommentData>>>,
policy: Rc<dyn TypeTablePolicy>,
}
Expand description
Parsing context data
Fields§
§names: Vec<HashSet<SmolStr>>
§comments: Option<BTreeMap<NodeSpan, Node<CommentData>>>
§policy: Rc<dyn TypeTablePolicy>
Implementations§
source§impl ParseContextData
impl ParseContextData
sourcepub fn new() -> ParseContextData
pub fn new() -> ParseContextData
Create a new ParseContextData object
sourcepub fn with_policy(policy: impl TypeTablePolicy + 'static) -> ParseContextData
pub fn with_policy(policy: impl TypeTablePolicy + 'static) -> ParseContextData
Create a new ParseContextData object with the given type table policy
§Parameters
policy
: policy object managing the type table
sourcepub fn with_comments() -> ParseContextData
pub fn with_comments() -> ParseContextData
Create a new ParseContextData object with comments parsing enabled
sourcepub fn with_comments_and_policy(
policy: impl TypeTablePolicy + 'static,
) -> ParseContextData
pub fn with_comments_and_policy( policy: impl TypeTablePolicy + 'static, ) -> ParseContextData
Create a new ParseContextData object with comments parsing enabled and the given type table policy
§Parameters
policy
: policy object managing the type table
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: Node<IdentifierData>,
) -> Node<TypeNameData>
pub fn add_type_name( &mut self, name: Node<IdentifierData>, ) -> Node<TypeNameData>
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: &Node<IdentifierData>,
ctx: IdentifierContext,
)
pub fn new_identifier( &mut self, name: &Node<IdentifierData>, 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: Node<CommentData>)
pub fn add_comment(&mut self, comment: Node<CommentData>)
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§fn default() -> ParseContextData
fn default() -> ParseContextData
Returns the “default value” for a type. Read more
source§impl From<ParseContextData> for ParseContext
impl From<ParseContextData> for ParseContext
source§fn from(data: ParseContextData) -> ParseContext
fn from(data: ParseContextData) -> ParseContext
Converts to this type from the input type.
source§impl PartialEq for ParseContextData
impl PartialEq for ParseContextData
source§fn eq(&self, other: &ParseContextData) -> bool
fn eq(&self, other: &ParseContextData) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.Auto Trait Implementations§
impl Freeze for ParseContextData
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more