docs(parser): add details

This commit is contained in:
Boshen 2023-04-02 00:23:21 +08:00
parent 61d2aedd43
commit e576b50fe2
No known key found for this signature in database
GPG key ID: 9C7A8C8AB22BEBD1

View file

@ -8,8 +8,10 @@
//! * No other heap allocations are done expect the above two
//! * SIMD is used for skipping whitespace and multiline comments
//! * [oxc_ast::Span] offsets uses `u32` instead of `usize`
//! * Scope binding, symbol resolution and complicated syntax errors are not done in the parser,
//! they are deligated to the [semantic analyzer](https://docs.rs/oxc_semantic)
//!
//! # Parser Conformance
//! # Conformance
//! The parser parses all of Test262 and most of Babel and TypeScript parser conformance tests.
//!
//! See [oxc coverage](https://github.com/Boshen/oxc/tree/main/tasks/coverage) for details
@ -24,6 +26,14 @@
//! AST Parsed : 2330/2340 (99.57%)
//! ```
//!
//! # 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
//! <https://github.com/Boshen/oxc/blob/main/crates/oxc_parser/examples/parser.rs>
//!
@ -78,7 +88,7 @@ use crate::{
state::ParserState,
};
/// Return value of parser
/// Return value of parser consisting of AST, errors and comments
///
/// The parser always return a valid AST.
/// When `panicked = true`, then program will always be empty.