Skip to main content

Alterator

Trait Alterator 

Source
pub trait Alterator
where Self: Checker,
{ // Provided methods fn alterate( node: &Node<'_>, code: &[u8], span: bool, children: Vec<AstNode>, ) -> AstNode { ... } fn get_text_span( node: &Node<'_>, code: &[u8], span: bool, text: bool, ) -> (String, Span) { ... } fn get_default( node: &Node<'_>, code: &[u8], span: bool, children: Vec<AstNode>, ) -> AstNode { ... } fn get_ast_node( node: &Node<'_>, code: &[u8], children: Vec<AstNode>, span: bool, comment: bool, ) -> Option<AstNode> { ... } }
Expand description

A trait to create a richer AST node for a programming language, mainly thought to be sent on the network.

Provided Methods§

Source

fn alterate( node: &Node<'_>, code: &[u8], span: bool, children: Vec<AstNode>, ) -> AstNode

Creates a new AST node containing the code associated to the node, its span, and its children.

This function can be overloaded according to the needs of each programming language.

Source

fn get_text_span( node: &Node<'_>, code: &[u8], span: bool, text: bool, ) -> (String, Span)

Gets the code as text and the span associated to a node.

Source

fn get_default( node: &Node<'_>, code: &[u8], span: bool, children: Vec<AstNode>, ) -> AstNode

Gets a default AST node containing the code associated to the node, its span, and its children.

Source

fn get_ast_node( node: &Node<'_>, code: &[u8], children: Vec<AstNode>, span: bool, comment: bool, ) -> Option<AstNode>

Gets a new AST node if and only if the code is not a comment, otherwise None is returned.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§