Skip to content
This repository was archived by the owner on Jul 27, 2023. It is now read-only.

Prototype of a new lexer #36

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ num-complex = "0.4.0"
num-bigint = "0.4.3"
num-traits = "0.2"
pyo3 = { version = "0.19.0" }
malachite-bigint = { version = "0.1.0" }
memchr = "2.5.0"
rand = "0.8.5"
serde = "1.0"
Expand Down
4 changes: 1 addition & 3 deletions ast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ repository = "https://github.com/RustPython/Parser/"
license = "MIT"

[features]
default = ["malachite-bigint"]

[dependencies]
rustpython-parser-core = { workspace = true }
rustpython-literal = { workspace = true, optional = true }

is-macro = { workspace = true }
num-bigint = { workspace = true, optional = true }
malachite-bigint = { workspace = true, optional = true }
num-bigint = { workspace = true }
static_assertions = "1.1.0"
2 changes: 1 addition & 1 deletion ast/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

use rustpython_parser_core::text_size::TextRange;

use crate::bigint::BigInt;
use crate::Ranged;
use num_bigint::BigInt;

pub type String = std::string::String;

Expand Down
3 changes: 0 additions & 3 deletions ast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ mod generic;
mod impls;
mod ranged;

#[cfg(feature = "malachite-bigint")]
pub use malachite_bigint as bigint;
#[cfg(all(feature = "num-bigint", not(feature = "malachite-bigint")))]
pub use num_bigint as bigint;

pub use builtin::*;
Expand Down
6 changes: 1 addition & 5 deletions format/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,4 @@ rustpython-literal = { workspace = true }
bitflags = "2.3.1"
itertools = "0.10.5"
num-traits = { workspace = true }
num-bigint = { workspace = true, optional = true }
malachite-bigint = { workspace = true, optional = true }

[features]
default = ["malachite-bigint"]
num-bigint = { workspace = true }
3 changes: 0 additions & 3 deletions format/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#[cfg(feature = "malachite-bigint")]
pub use malachite_bigint as bigint;
#[cfg(all(feature = "num-bigint", not(feature = "malachite-bigint")))]
pub use num_bigint as bigint;

pub use crate::format::*;
Expand Down
1 change: 1 addition & 0 deletions literal/src/escape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ impl<'a> Escape for AsciiEscape<'a> {
&self.layout
}

#[allow(unsafe_code)]
fn write_source(&self, formatter: &mut impl std::fmt::Write) -> std::fmt::Result {
formatter.write_str(unsafe {
// SAFETY: this function must be called only when source is printable ascii characters
Expand Down
9 changes: 3 additions & 6 deletions parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ license = "MIT"
edition = "2021"

[features]
default = ["malachite-bigint"]
serde = ["dep:serde", "rustpython-parser-core/serde"]
full-lexer = []
malachite-bigint = ["dep:malachite-bigint", "rustpython-ast/malachite-bigint"]
num-bigint = ["dep:num-bigint", "rustpython-ast/num-bigint"]

[build-dependencies]
anyhow = { workspace = true }
Expand All @@ -25,11 +21,11 @@ tiny-keccak = { version = "2", features = ["sha3"] }
rustpython-ast = { workspace = true }
rustpython-parser-core = { workspace = true }

bitflags = "2.3.3"
itertools = { workspace = true }
is-macro = { workspace = true }
log = { workspace = true }
malachite-bigint = { workspace = true, optional = true }
num-bigint = { workspace = true, optional = true }
num-bigint = { workspace = true }
num-traits = { workspace = true }
unicode_names2 = { workspace = true }

Expand All @@ -38,6 +34,7 @@ unic-ucd-ident = "0.9.0"
lalrpop-util = { version = "0.20.0", default-features = false }
phf = "0.11.1"
rustc-hash = "1.1.0"
static_assertions = "1.1.0"
serde = { version = "1.0.133", optional = true, default-features = false, features = ["derive"] }

[dev-dependencies]
Expand Down
Loading