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

Commit dc3c4b1

Browse files
committed
Prototype of a new lexer
1 parent 4d03b9b commit dc3c4b1

File tree

58 files changed

+7611
-1282
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+7611
-1282
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ num-complex = "0.4.0"
3232
num-bigint = "0.4.3"
3333
num-traits = "0.2"
3434
pyo3 = { version = "0.19.0" }
35-
malachite-bigint = { version = "0.1.0" }
3635
memchr = "2.5.0"
3736
rand = "0.8.5"
3837
serde = "1.0"

ast/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ repository = "https://github.com/RustPython/Parser/"
88
license = "MIT"
99

1010
[features]
11-
default = ["malachite-bigint"]
1211

1312
[dependencies]
1413
rustpython-parser-core = { workspace = true }
1514
rustpython-literal = { workspace = true, optional = true }
1615

1716
is-macro = { workspace = true }
18-
num-bigint = { workspace = true, optional = true }
19-
malachite-bigint = { workspace = true, optional = true }
17+
num-bigint = { workspace = true }
2018
static_assertions = "1.1.0"

ast/src/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
33
use rustpython_parser_core::text_size::TextRange;
44

5-
use crate::bigint::BigInt;
65
use crate::Ranged;
6+
use num_bigint::BigInt;
77

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

ast/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ mod generic;
2020
mod impls;
2121
mod ranged;
2222

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

2825
pub use builtin::*;

format/Cargo.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,4 @@ rustpython-literal = { workspace = true }
1313
bitflags = "2.3.1"
1414
itertools = "0.10.5"
1515
num-traits = { workspace = true }
16-
num-bigint = { workspace = true, optional = true }
17-
malachite-bigint = { workspace = true, optional = true }
18-
19-
[features]
20-
default = ["malachite-bigint"]
16+
num-bigint = { workspace = true }

format/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#[cfg(feature = "malachite-bigint")]
2-
pub use malachite_bigint as bigint;
3-
#[cfg(all(feature = "num-bigint", not(feature = "malachite-bigint")))]
41
pub use num_bigint as bigint;
52

63
pub use crate::format::*;

literal/src/escape.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ impl<'a> Escape for AsciiEscape<'a> {
386386
&self.layout
387387
}
388388

389+
#[allow(unsafe_code)]
389390
fn write_source(&self, formatter: &mut impl std::fmt::Write) -> std::fmt::Result {
390391
formatter.write_str(unsafe {
391392
// SAFETY: this function must be called only when source is printable ascii characters

parser/Cargo.toml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ license = "MIT"
99
edition = "2021"
1010

1111
[features]
12-
default = ["malachite-bigint"]
1312
serde = ["dep:serde", "rustpython-parser-core/serde"]
14-
full-lexer = []
15-
malachite-bigint = ["dep:malachite-bigint", "rustpython-ast/malachite-bigint"]
16-
num-bigint = ["dep:num-bigint", "rustpython-ast/num-bigint"]
1713

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

24+
bitflags = "2.3.3"
2825
itertools = { workspace = true }
2926
is-macro = { workspace = true }
3027
log = { workspace = true }
31-
malachite-bigint = { workspace = true, optional = true }
32-
num-bigint = { workspace = true, optional = true }
28+
num-bigint = { workspace = true }
3329
num-traits = { workspace = true }
3430
unicode_names2 = { workspace = true }
3531

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

4340
[dev-dependencies]

0 commit comments

Comments
 (0)