mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-09 22:25:23 +00:00
Introduce rustpython-format
crate
This commit is contained in:
parent
263f96fe7b
commit
895f923567
11 changed files with 1254 additions and 1238 deletions
|
@ -11,14 +11,14 @@ include = ["LICENSE", "Cargo.toml", "src/**/*.rs"]
|
||||||
[workspace]
|
[workspace]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
members = [
|
members = [
|
||||||
"ast", "core", "literal", "parser",
|
"ast", "core", "format", "literal", "parser",
|
||||||
"ruff_text_size", "ruff_source_location",
|
"ruff_text_size", "ruff_source_location",
|
||||||
]
|
]
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
rustpython-ast = { path = "ast", version = "0.2.0", default-features = false }
|
rustpython-ast = { path = "ast", default-features = false }
|
||||||
rustpython-parser-core = { path = "core", version = "0.2.0", default-features = false }
|
rustpython-parser-core = { path = "core", default-features = false }
|
||||||
rustpython-literal = { path = "literal", version = "0.2.0" }
|
rustpython-literal = { path = "literal" }
|
||||||
|
|
||||||
ahash = "0.7.6"
|
ahash = "0.7.6"
|
||||||
anyhow = "1.0.45"
|
anyhow = "1.0.45"
|
||||||
|
|
|
@ -4,7 +4,7 @@ version = "0.2.0"
|
||||||
description = "AST definitions for RustPython"
|
description = "AST definitions for RustPython"
|
||||||
authors = ["RustPython Team"]
|
authors = ["RustPython Team"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
repository = "https://github.com/RustPython/RustPython"
|
repository = "https://github.com/RustPython/Parser/"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|
|
@ -4,7 +4,7 @@ description = "RustPython parser data types."
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
authors = ["RustPython Team"]
|
authors = ["RustPython Team"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
repository = "https://github.com/RustPython/RustPython"
|
repository = "https://github.com/RustPython/Parser/"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
16
format/Cargo.toml
Normal file
16
format/Cargo.toml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
[package]
|
||||||
|
name = "rustpython-format"
|
||||||
|
edition = "2021"
|
||||||
|
version = "0.2.0"
|
||||||
|
description = "Format helpers for RustPython"
|
||||||
|
authors = ["RustPython Team"]
|
||||||
|
repository = "https://github.com/RustPython/Parser/"
|
||||||
|
license = "MIT"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
rustpython-literal = { workspace = true }
|
||||||
|
|
||||||
|
bitflags = "2.2.1"
|
||||||
|
itertools = "0.10.5"
|
||||||
|
num-bigint = { workspace = true }
|
||||||
|
num-traits = { workspace = true }
|
|
@ -1,9 +1,9 @@
|
||||||
//! Implementation of Printf-Style string formatting
|
//! Implementation of Printf-Style string formatting
|
||||||
//! as per the [Python Docs](https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting).
|
//! as per the [Python Docs](https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting).
|
||||||
use crate::{float, format::Case};
|
|
||||||
use bitflags::bitflags;
|
use bitflags::bitflags;
|
||||||
use num_bigint::{BigInt, Sign};
|
use num_bigint::{BigInt, Sign};
|
||||||
use num_traits::Signed;
|
use num_traits::Signed;
|
||||||
|
use rustpython_literal::{float, format::Case};
|
||||||
use std::{
|
use std::{
|
||||||
cmp, fmt,
|
cmp, fmt,
|
||||||
iter::{Enumerate, Peekable},
|
iter::{Enumerate, Peekable},
|
1224
format/src/format.rs
Normal file
1224
format/src/format.rs
Normal file
File diff suppressed because it is too large
Load diff
4
format/src/lib.rs
Normal file
4
format/src/lib.rs
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
pub mod cformat;
|
||||||
|
mod format;
|
||||||
|
|
||||||
|
pub use crate::format::*;
|
|
@ -4,16 +4,13 @@ version = "0.2.0"
|
||||||
description = "Common literal handling utilities mostly useful for unparse and repr."
|
description = "Common literal handling utilities mostly useful for unparse and repr."
|
||||||
authors = ["RustPython Team"]
|
authors = ["RustPython Team"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
repository = "https://github.com/RustPython/RustPython"
|
repository = "https://github.com/RustPython/Parser/"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bitflags = "2.2.1"
|
|
||||||
itertools = "0.10.5"
|
|
||||||
num-bigint = { workspace = true }
|
|
||||||
num-traits = { workspace = true }
|
|
||||||
hexf-parse = "0.2.1"
|
hexf-parse = "0.2.1"
|
||||||
lexical-parse-float = { version = "0.8.0", features = ["format"] }
|
lexical-parse-float = { version = "0.8.0", features = ["format"] }
|
||||||
|
num-traits = { workspace = true }
|
||||||
unic-ucd-category = "0.9"
|
unic-ucd-category = "0.9"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,3 @@
|
||||||
pub mod cformat;
|
|
||||||
pub mod char;
|
pub mod char;
|
||||||
pub mod escape;
|
pub mod escape;
|
||||||
pub mod float;
|
pub mod float;
|
||||||
|
|
|
@ -4,7 +4,7 @@ version = "0.2.0"
|
||||||
description = "Parser for python code."
|
description = "Parser for python code."
|
||||||
authors = ["RustPython Team"]
|
authors = ["RustPython Team"]
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
repository = "https://github.com/RustPython/RustPython"
|
repository = "https://github.com/RustPython/Parser/"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue