mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-25 22:14:25 +00:00
reorganize compiler crates
This commit is contained in:
parent
ffacac05bb
commit
53c48bf6b9
66 changed files with 12079 additions and 152 deletions
34
parser/src/lib.rs
Normal file
34
parser/src/lib.rs
Normal file
|
@ -0,0 +1,34 @@
|
|||
//! This crate can be used to parse python sourcecode into a so
|
||||
//! called AST (abstract syntax tree).
|
||||
//!
|
||||
//! The stages involved in this process are lexical analysis and
|
||||
//! parsing. The lexical analysis splits the sourcecode into
|
||||
//! tokens, and the parsing transforms those tokens into an AST.
|
||||
//!
|
||||
//! For example, one could do this:
|
||||
//!
|
||||
//! ```
|
||||
//! use rustpython_parser::{parser, ast};
|
||||
//!
|
||||
//! let python_source = "print('Hello world')";
|
||||
//! let python_ast = parser::parse_expression(python_source).unwrap();
|
||||
//!
|
||||
//! ```
|
||||
|
||||
#![doc(html_logo_url = "https://raw.githubusercontent.com/RustPython/RustPython/main/logo.png")]
|
||||
#![doc(html_root_url = "https://docs.rs/rustpython-parser/")]
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
pub use rustpython_ast as ast;
|
||||
|
||||
pub mod error;
|
||||
mod fstring;
|
||||
mod function;
|
||||
pub mod lexer;
|
||||
pub mod mode;
|
||||
pub mod parser;
|
||||
#[rustfmt::skip]
|
||||
mod python;
|
||||
mod string;
|
||||
pub mod token;
|
Loading…
Add table
Add a link
Reference in a new issue