Struct NodeCounter

Source
pub struct NodeCounter {
    pub count: NodeCount,
}

Fields§

§count: NodeCount

Implementations§

Source§

impl NodeCounter

Source

pub fn new() -> Self

Trait Implementations§

Source§

impl Default for NodeCounter

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Visitor for NodeCounter

Source§

type Output = ()

Source§

fn visit_node(&mut self, node: &Node)

Source§

fn visit_program(&mut self, program: &Program) -> Self::Output

Source§

fn visit_variable_declaration( &mut self, decl: &VariableDeclaration, ) -> Self::Output

Source§

fn visit_function_declaration( &mut self, decl: &FunctionDeclaration, ) -> Self::Output

Source§

fn visit_class_declaration(&mut self, decl: &ClassDeclaration) -> Self::Output

Source§

fn visit_binary_expression(&mut self, expr: &BinaryExpression) -> Self::Output

Source§

fn visit_unary_expression(&mut self, expr: &UnaryExpression) -> Self::Output

Source§

fn visit_call_expression(&mut self, expr: &CallExpression) -> Self::Output

Source§

fn visit_new_expression(&mut self, expr: &NewExpression) -> Self::Output

Source§

fn visit_member_expression(&mut self, expr: &MemberExpression) -> Self::Output

Source§

fn visit_assignment_expression( &mut self, expr: &AssignmentExpression, ) -> Self::Output

Source§

fn visit_conditional_expression( &mut self, expr: &ConditionalExpression, ) -> Self::Output

Source§

fn visit_logical_expression(&mut self, expr: &LogicalExpression) -> Self::Output

Source§

fn visit_update_expression(&mut self, expr: &UpdateExpression) -> Self::Output

Source§

fn visit_block_statement(&mut self, stmt: &BlockStatement) -> Self::Output

Source§

fn visit_if_statement(&mut self, stmt: &IfStatement) -> Self::Output

Source§

fn visit_for_statement(&mut self, stmt: &ForStatement) -> Self::Output

Source§

fn visit_for_in_statement(&mut self, stmt: &ForInStatement) -> Self::Output

Source§

fn visit_for_of_statement(&mut self, stmt: &ForOfStatement) -> Self::Output

Source§

fn visit_while_statement(&mut self, stmt: &WhileStatement) -> Self::Output

Source§

fn visit_do_while_statement(&mut self, stmt: &DoWhileStatement) -> Self::Output

Source§

fn visit_switch_statement(&mut self, stmt: &SwitchStatement) -> Self::Output

Source§

fn visit_try_statement(&mut self, stmt: &TryStatement) -> Self::Output

Source§

fn visit_catch_clause(&mut self, clause: &CatchClause) -> Self::Output

Source§

fn visit_throw_statement(&mut self, stmt: &ThrowStatement) -> Self::Output

Source§

fn visit_return_statement(&mut self, stmt: &ReturnStatement) -> Self::Output

Source§

fn visit_break_statement(&mut self, _stmt: &BreakStatement) -> Self::Output

Source§

fn visit_continue_statement( &mut self, _stmt: &ContinueStatement, ) -> Self::Output

Source§

fn visit_expression_statement( &mut self, stmt: &ExpressionStatement, ) -> Self::Output

Source§

fn visit_array_literal(&mut self, lit: &ArrayLiteral) -> Self::Output

Source§

fn visit_object_literal(&mut self, lit: &ObjectLiteral) -> Self::Output

Source§

fn visit_property(&mut self, prop: &Property) -> Self::Output

Source§

fn visit_identifier(&mut self, _id: &str) -> Self::Output

Source§

fn visit_number(&mut self, _num: f64) -> Self::Output

Source§

fn visit_string(&mut self, _s: &str) -> Self::Output

Source§

fn visit_boolean(&mut self, _b: bool) -> Self::Output

Source§

fn visit_null(&mut self) -> Self::Output

Source§

fn visit_undefined(&mut self) -> Self::Output

Source§

fn visit_this(&mut self) -> Self::Output

Source§

fn visit_arrow_function_expression( &mut self, expr: &ArrowFunctionExpression, ) -> Self::Output

Source§

fn visit_function_expression( &mut self, expr: &FunctionExpression, ) -> Self::Output

Source§

fn visit_class_expression(&mut self, expr: &ClassExpression) -> Self::Output

Source§

fn visit_yield_expression(&mut self, expr: &YieldExpression) -> Self::Output

Source§

fn visit_await_expression(&mut self, expr: &AwaitExpression) -> Self::Output

Source§

fn visit_super(&mut self, _super_expr: &Super) -> Self::Output

Source§

fn visit_meta_property(&mut self, _prop: &MetaProperty) -> Self::Output

Source§

fn visit_spread_element(&mut self, elem: &SpreadElement) -> Self::Output

Source§

fn visit_rest_element(&mut self, elem: &RestElement) -> Self::Output

Source§

fn visit_template_literal(&mut self, lit: &TemplateLiteral) -> Self::Output

Source§

fn visit_tagged_template_expression( &mut self, expr: &TaggedTemplateExpression, ) -> Self::Output

Source§

fn visit_import_declaration(&mut self, decl: &ImportDeclaration) -> Self::Output

Source§

fn visit_export_declaration(&mut self, decl: &ExportDeclaration) -> Self::Output

Source§

fn visit_labeled_statement(&mut self, stmt: &LabeledStatement) -> Self::Output

Source§

fn visit_with_statement(&mut self, stmt: &WithStatement) -> Self::Output

Source§

fn visit_debugger_statement( &mut self, _stmt: &DebuggerStatement, ) -> Self::Output

Source§

fn visit_bigint(&mut self, _bigint: &str) -> Self::Output

Source§

fn visit_regexp(&mut self, _regexp: &RegExp) -> Self::Output

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.