Trait SyntaxNodeExt

Source
pub trait SyntaxNodeExt {
    // Required methods
    fn except_comments(&self) -> impl Iterator<Item = SyntaxToken> + '_;
    fn rule_exceptions(&self) -> HashSet<String>;
    fn is_rule_excepted(&self, id: &str) -> bool;
}
Expand description

An extension trait for syntax nodes.

Required Methods§

Source

fn except_comments(&self) -> impl Iterator<Item = SyntaxToken> + '_

Gets an iterator over the @except comments for a syntax node.

Source

fn rule_exceptions(&self) -> HashSet<String>

Gets the AST node’s rule exceptions set.

The set is the comma-delimited list of rule identifiers that follows a #@ except: comment.

Source

fn is_rule_excepted(&self, id: &str) -> bool

Determines if a given rule id is excepted for the syntax node.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl SyntaxNodeExt for SyntaxNode

Implementors§