oxc_parser 0.25.0

A collection of JavaScript tools written in Rust.
Documentation
Oxc Parser for JavaScript and TypeScript # Performance The following optimization techniques are used: * AST is allocated in a memory arena ([bumpalo](https://docs.rs/bumpalo)) for fast AST drop * [oxc_span::Span] offsets uses `u32` instead of `usize` * Scope binding, symbol resolution and complicated syntax errors are not done in the parser, they are delegated to the [semantic analyzer](https://docs.rs/oxc_semantic) # Usage The parser has a minimal API with three inputs and one return struct ([ParserReturn]). ```rust let parser_return = Parser::new(&allocator, &source_text, source_type).parse(); ``` # Example ```rust ``` # Visitor See [oxc_ast::Visit] and [oxc_ast::VisitMut] # Visiting without a visitor For ad-hoc tasks, the semantic analyzer can be used to get a parent pointing tree with untyped nodes, the nodes can be iterated through a sequential loop. ```rust for node in semantic.nodes().iter() { match node.kind() { // check node } } ``` See [full linter example](https://github.com/Boshen/oxc/blob/ab2ef4f89ba3ca50c68abb2ca43e36b7793f3673/crates/oxc_linter/examples/linter.rs#L38-L39)