mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-14 06:15:13 +00:00
Add basic docs for the parser crate (#11199)
## Summary This PR adds a basic README for the `ruff_python_parser` crate and updates the CONTRIBUTING docs with the fuzzer and benchmark section. Additionally, it also updates some inline documentation within the parser crate and splits the `parse_program` function into `parse_single_expression` and `parse_module` which will be called by matching against the `Mode`. This PR doesn't go into too much internal detail around the parser logic due to the following reasons: 1. Where should the docs go? Should it be as a module docs in `lib.rs` or in README? 2. The parser is still evolving and could include a lot of refactors with the future work (feedback loop and improved error recovery and resilience) --------- Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
0ed7af35ec
commit
04a922866a
7 changed files with 199 additions and 67 deletions
|
@ -1,10 +1,13 @@
|
|||
use crate::{parse_expression, parse_expression_starts_at};
|
||||
//! This module takes care of parsing a type annotation.
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
use ruff_python_ast::relocate::relocate_expr;
|
||||
use ruff_python_ast::str;
|
||||
use ruff_python_ast::Expr;
|
||||
use ruff_python_ast::{str, Expr};
|
||||
use ruff_text_size::{TextLen, TextRange};
|
||||
|
||||
use crate::{parse_expression, parse_expression_starts_at};
|
||||
|
||||
#[derive(is_macro::Is, Copy, Clone, Debug)]
|
||||
pub enum AnnotationKind {
|
||||
/// The annotation is defined as part a simple string literal,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue