num_bigint to malachite_bigint

This commit is contained in:
Kangzhi Shi 2023-05-10 21:50:49 +02:00 committed by Jeong YunWon
parent 33a3c407a9
commit 6b90a006a1
13 changed files with 15 additions and 16 deletions

View file

@ -30,9 +30,9 @@ itertools = "0.10.3"
is-macro = "0.2.2"
log = "0.4.16"
num-complex = "0.4.0"
num-bigint = "0.4.3"
num-traits = "0.2"
pyo3 = { version = "0.18.3" }
malachite-bigint = { version = "0.1.5", git = "https://github.com/qingshi163/malachite-bigint.git" }
rand = "0.8.5"
serde = "1.0"
static_assertions = "1.1"

View file

@ -26,8 +26,8 @@ rustpython-parser-core = { workspace = true }
rustpython-literal = { workspace = true, optional = true }
is-macro = { workspace = true }
num-bigint = { workspace = true }
static_assertions = "1.1.0"
num-complex = { workspace = true, optional = true }
once_cell = { workspace = true, optional = true }
pyo3 = { workspace = true, optional = true, features = ["num-bigint", "num-complex"] }
malachite-bigint = { workspace = true }

View file

@ -1,6 +1,6 @@
//! `builtin_types` in asdl.py and Attributed
use num_bigint::BigInt;
use malachite_bigint::BigInt;
pub type String = std::string::String;

View file

@ -55,7 +55,7 @@ impl<U> crate::fold::Fold<U> for ConstantOptimizer {
#[cfg(test)]
mod tests {
use num_bigint::BigInt;
use malachite_bigint::BigInt;
use rustpython_parser_core::text_size::TextRange;
#[cfg(feature = "constant-optimization")]

View file

@ -12,5 +12,5 @@ rustpython-literal = { workspace = true }
bitflags = "2.3.1"
itertools = "0.10.5"
num-bigint = { workspace = true }
malachite-bigint = { workspace = true }
num-traits = { workspace = true }

View file

@ -1,7 +1,7 @@
//! Implementation of Printf-Style string formatting
//! as per the [Python Docs](https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting).
use bitflags::bitflags;
use num_bigint::{BigInt, Sign};
use malachite_bigint::{BigInt, Sign};
use num_traits::Signed;
use rustpython_literal::{float, format::Case};
use std::{

View file

@ -1,5 +1,5 @@
use itertools::{Itertools, PeekingNext};
use num_bigint::{BigInt, Sign};
use malachite_bigint::{BigInt, Sign};
use num_traits::{cast::ToPrimitive, Signed};
use rustpython_literal::float;
use rustpython_literal::format::Case;

View file

@ -28,7 +28,7 @@ rustpython-parser-core = { workspace = true }
itertools = { workspace = true }
is-macro = { workspace = true }
log = { workspace = true }
num-bigint = { workspace = true }
malachite-bigint = { workspace = true }
num-traits = { workspace = true }
unicode_names2 = { workspace = true }

View file

@ -35,7 +35,7 @@ use crate::{
Mode,
};
use log::trace;
use num_bigint::BigInt;
use malachite_bigint::BigInt;
use num_traits::{Num, Zero};
use std::{char, cmp::Ordering, ops::Index, slice::SliceIndex, str::FromStr};
use unic_emoji_char::is_emoji_presentation;
@ -1360,7 +1360,7 @@ impl std::fmt::Display for LexicalErrorType {
#[cfg(test)]
mod tests {
use super::*;
use num_bigint::BigInt;
use malachite_bigint::BigInt;
const WINDOWS_EOL: &str = "\r\n";
const MAC_EOL: &str = "\r";

View file

@ -64,7 +64,6 @@ pub fn parse_program(source: &str, source_path: &str) -> Result<ast::Suite, Pars
/// For example, parsing a single expression denoting the addition of two numbers:
///
/// ```
/// extern crate num_bigint;
/// use rustpython_parser as parser;
/// let expr = parser::parse_expression("1 + 2", "<embedded>");
///

View file

@ -12,7 +12,7 @@ use crate::{
token::{self, StringKind},
text_size::TextSize, parser::optional_range
};
use num_bigint::BigInt;
use malachite_bigint::BigInt;
grammar;

6
parser/src/python.rs generated
View file

@ -1,5 +1,5 @@
// auto-generated: "lalrpop 0.20.0"
// sha3: a33e9abb4be2a3730161519ce0f298452edbc50335b9e0c812d5a1730f1d8816
// sha3: e93e275b482298e87994a5d4547a9a05abe562081b6eb1550130be5fb790eff6
use crate::{
ast::{self as ast, Ranged},
lexer::{LexicalError, LexicalErrorType},
@ -9,7 +9,7 @@ use crate::{
token::{self, StringKind},
text_size::TextSize, parser::optional_range
};
use num_bigint::BigInt;
use malachite_bigint::BigInt;
#[allow(unused_extern_crates)]
extern crate lalrpop_util as __lalrpop_util;
#[allow(unused_imports)]
@ -30,7 +30,7 @@ mod __parse__Top {
token::{self, StringKind},
text_size::TextSize, parser::optional_range
};
use num_bigint::BigInt;
use malachite_bigint::BigInt;
#[allow(unused_extern_crates)]
extern crate lalrpop_util as __lalrpop_util;
#[allow(unused_imports)]

View file

@ -5,7 +5,7 @@
//!
//! [CPython source]: https://github.com/python/cpython/blob/dfc2e065a2e71011017077e549cd2f9bf4944c54/Include/internal/pycore_token.h
use crate::{text_size::TextSize, Mode};
use num_bigint::BigInt;
use malachite_bigint::BigInt;
use std::fmt;
/// The set of tokens the Python source code can be tokenized in.