mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Change underscore into hyphen
This commit is contained in:
1 parent
4a108c1ef5
commit
bedbad284e
15 files changed
+56
-61
No files matched your search
Generated
+19
-19
@@ -957,15 +957,15 @@ dependencies = [
|
||||
"cpython 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustpython_compiler 0.1.0",
|
||||
"rustpython_parser 0.0.1",
|
||||
"rustpython_vm 0.1.0",
|
||||
"rustpython-compiler 0.1.0",
|
||||
"rustpython-parser 0.0.1",
|
||||
"rustpython-vm 0.1.0",
|
||||
"rustyline 4.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"xdg 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustpython_bytecode"
|
||||
name = "rustpython-bytecode"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -975,30 +975,30 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustpython_compiler"
|
||||
name = "rustpython-compiler"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-complex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustpython_bytecode 0.1.0",
|
||||
"rustpython_parser 0.0.1",
|
||||
"rustpython-bytecode 0.1.0",
|
||||
"rustpython-parser 0.0.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustpython_derive"
|
||||
name = "rustpython-derive"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro-hack 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustpython_bytecode 0.1.0",
|
||||
"rustpython_compiler 0.1.0",
|
||||
"rustpython-bytecode 0.1.0",
|
||||
"rustpython-compiler 0.1.0",
|
||||
"syn 0.15.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustpython_parser"
|
||||
name = "rustpython-parser"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"lalrpop 0.16.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1014,7 +1014,7 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustpython_vm"
|
||||
name = "rustpython-vm"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1043,10 +1043,10 @@ dependencies = [
|
||||
"rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc_version_runtime 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustpython_bytecode 0.1.0",
|
||||
"rustpython_compiler 0.1.0",
|
||||
"rustpython_derive 0.1.0",
|
||||
"rustpython_parser 0.0.1",
|
||||
"rustpython-bytecode 0.1.0",
|
||||
"rustpython-compiler 0.1.0",
|
||||
"rustpython-derive 0.1.0",
|
||||
"rustpython-parser 0.0.1",
|
||||
"serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1069,9 +1069,9 @@ dependencies = [
|
||||
"futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"js-sys 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustpython_compiler 0.1.0",
|
||||
"rustpython_parser 0.0.1",
|
||||
"rustpython_vm 0.1.0",
|
||||
"rustpython-compiler 0.1.0",
|
||||
"rustpython-parser 0.0.1",
|
||||
"rustpython-vm 0.1.0",
|
||||
"serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde-wasm-bindgen 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasm-bindgen 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
||||
+3
-3
@@ -16,9 +16,9 @@ path = "./benchmarks/bench.rs"
|
||||
log="0.4.1"
|
||||
env_logger="0.5.10"
|
||||
clap = "2.31.2"
|
||||
rustpython_compiler = {path = "compiler"}
|
||||
rustpython_parser = {path = "parser"}
|
||||
rustpython_vm = {path = "vm"}
|
||||
rustpython-compiler = {path = "compiler"}
|
||||
rustpython-parser = {path = "parser"}
|
||||
rustpython-vm = {path = "vm"}
|
||||
rustyline = "4.1.0"
|
||||
xdg = "2.2.0"
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "rustpython_bytecode"
|
||||
name = "rustpython-bytecode"
|
||||
version = "0.1.0"
|
||||
authors = ["Windel Bouwman <windel@windel.nl>"]
|
||||
edition = "2018"
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
[package]
|
||||
name = "rustpython_compiler"
|
||||
name = "rustpython-compiler"
|
||||
version = "0.1.0"
|
||||
authors = ["coolreader18 <33094578+coolreader18@users.noreply.github.com>", "Windel Bouwman <windel@windel.nl>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
rustpython_bytecode = { path = "../bytecode" }
|
||||
rustpython_parser = { path = "../parser" }
|
||||
rustpython-bytecode = { path = "../bytecode" }
|
||||
rustpython-parser = { path = "../parser" }
|
||||
num-complex = { version = "0.2", features = ["serde"] }
|
||||
log = "0.3"
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "rustpython_derive"
|
||||
name = "rustpython-derive"
|
||||
version = "0.1.0"
|
||||
authors = ["Joey <jmhain@protonmail.com>"]
|
||||
edition = "2018"
|
||||
@@ -11,7 +11,7 @@ proc-macro = true
|
||||
syn = { version = "0.15.29", features = ["full"] }
|
||||
quote = "0.6.11"
|
||||
proc-macro2 = "0.4.27"
|
||||
rustpython_compiler = { path = "../compiler" }
|
||||
rustpython_bytecode = { path = "../bytecode" }
|
||||
rustpython-compiler = { path = "../compiler" }
|
||||
rustpython-bytecode = { path = "../bytecode" }
|
||||
bincode = "1.1"
|
||||
proc-macro-hack = "0.5"
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "rustpython_parser"
|
||||
name = "rustpython-parser"
|
||||
version = "0.0.1"
|
||||
authors = [ "Shing Lyu", "Windel Bouwman" ]
|
||||
build = "build.rs"
|
||||
|
||||
@@ -44,7 +44,6 @@ pub fn parse_statement(source: &str) -> Result<Vec<ast::LocatedStatement>, Parse
|
||||
/// # Example
|
||||
/// ```
|
||||
/// extern crate num_bigint;
|
||||
/// extern crate rustpython_parser;
|
||||
/// use num_bigint::BigInt;
|
||||
/// use rustpython_parser::{parser, ast};
|
||||
/// let expr = parser::parse_expression("1+2").unwrap();
|
||||
|
||||
@@ -3,8 +3,6 @@ extern crate clap;
|
||||
extern crate env_logger;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
extern crate rustpython_parser;
|
||||
extern crate rustpython_vm;
|
||||
extern crate rustyline;
|
||||
|
||||
use clap::{App, Arg};
|
||||
|
||||
+6
-6
@@ -1,11 +1,11 @@
|
||||
[package]
|
||||
name = "rustpython_vm"
|
||||
name = "rustpython-vm"
|
||||
version = "0.1.0"
|
||||
authors = ["Shing Lyu <shing.lyu@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
[features]
|
||||
default = ["rustpython_parser", "rustpython_compiler"]
|
||||
default = ["rustpython-parser", "rustpython-compiler"]
|
||||
|
||||
[dependencies]
|
||||
# Crypto:
|
||||
@@ -23,10 +23,10 @@ num-integer = "0.1.39"
|
||||
num-rational = "0.2.1"
|
||||
rand = "0.5"
|
||||
log = "0.3"
|
||||
rustpython_derive = {path = "../derive"}
|
||||
rustpython_parser = {path = "../parser", optional = true}
|
||||
rustpython_compiler = {path = "../compiler", optional = true}
|
||||
rustpython_bytecode = { path = "../bytecode" }
|
||||
rustpython-derive = {path = "../derive"}
|
||||
rustpython-parser = {path = "../parser", optional = true}
|
||||
rustpython-compiler = {path = "../compiler", optional = true}
|
||||
rustpython-bytecode = { path = "../bytecode" }
|
||||
serde = { version = "1.0.66", features = ["derive"] }
|
||||
serde_json = "1.0.26"
|
||||
byteorder = "1.2.6"
|
||||
|
||||
+5
-5
@@ -18,7 +18,7 @@ use crate::obj::objint::{self, PyIntRef};
|
||||
use crate::obj::objiter;
|
||||
use crate::obj::objstr::{self, PyString, PyStringRef};
|
||||
use crate::obj::objtype::{self, PyClassRef};
|
||||
#[cfg(feature = "rustpython_compiler")]
|
||||
#[cfg(feature = "rustpython-compiler")]
|
||||
use rustpython_compiler::compile;
|
||||
|
||||
use crate::frame::Scope;
|
||||
@@ -99,7 +99,7 @@ struct CompileArgs {
|
||||
optimize: OptionalArg<PyIntRef>,
|
||||
}
|
||||
|
||||
#[cfg(feature = "rustpython_compiler")]
|
||||
#[cfg(feature = "rustpython-compiler")]
|
||||
fn builtin_compile(args: CompileArgs, vm: &VirtualMachine) -> PyResult<PyCodeRef> {
|
||||
// TODO: compile::compile should probably get bytes
|
||||
let source = match args.source {
|
||||
@@ -155,7 +155,7 @@ fn builtin_divmod(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult {
|
||||
|
||||
/// Implements `eval`.
|
||||
/// See also: https://docs.python.org/3/library/functions.html#eval
|
||||
#[cfg(feature = "rustpython_compiler")]
|
||||
#[cfg(feature = "rustpython-compiler")]
|
||||
fn builtin_eval(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult {
|
||||
// TODO: support any mapping for `locals`
|
||||
arg_check!(
|
||||
@@ -187,7 +187,7 @@ fn builtin_eval(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult {
|
||||
|
||||
/// Implements `exec`
|
||||
/// https://docs.python.org/3/library/functions.html#exec
|
||||
#[cfg(feature = "rustpython_compiler")]
|
||||
#[cfg(feature = "rustpython-compiler")]
|
||||
fn builtin_exec(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult {
|
||||
arg_check!(
|
||||
vm,
|
||||
@@ -789,7 +789,7 @@ pub fn make_module(vm: &VirtualMachine, module: PyObjectRef) {
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
let open = vm.ctx.new_rustfunc(io_open);
|
||||
|
||||
#[cfg(feature = "rustpython_compiler")]
|
||||
#[cfg(feature = "rustpython-compiler")]
|
||||
{
|
||||
extend_module!(vm, module, {
|
||||
"compile" => ctx.new_rustfunc(builtin_compile),
|
||||
|
||||
+3
-3
@@ -10,7 +10,7 @@ use crate::obj::{objcode, objsequence, objstr};
|
||||
use crate::pyobject::{ItemProtocol, PyResult, PyValue};
|
||||
use crate::util;
|
||||
use crate::vm::VirtualMachine;
|
||||
#[cfg(feature = "rustpython_compiler")]
|
||||
#[cfg(feature = "rustpython-compiler")]
|
||||
use rustpython_compiler::compile;
|
||||
|
||||
pub fn init_importlib(vm: &VirtualMachine) -> PyResult {
|
||||
@@ -57,7 +57,7 @@ pub fn import_module(vm: &VirtualMachine, current_path: PathBuf, module_name: &s
|
||||
import_frozen(vm, module_name)
|
||||
} else if vm.stdlib_inits.borrow().contains_key(module_name) {
|
||||
import_builtin(vm, module_name)
|
||||
} else if cfg!(feature = "rustpython_compiler") {
|
||||
} else if cfg!(feature = "rustpython-compiler") {
|
||||
let notfound_error = &vm.ctx.exceptions.module_not_found_error;
|
||||
let import_error = &vm.ctx.exceptions.import_error;
|
||||
|
||||
@@ -79,7 +79,7 @@ pub fn import_module(vm: &VirtualMachine, current_path: PathBuf, module_name: &s
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "rustpython_compiler")]
|
||||
#[cfg(feature = "rustpython-compiler")]
|
||||
pub fn import_file(
|
||||
vm: &VirtualMachine,
|
||||
module_name: &str,
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ pub mod macros;
|
||||
mod builtins;
|
||||
pub mod cformat;
|
||||
mod dictdatatype;
|
||||
#[cfg(feature = "rustpython_compiler")]
|
||||
#[cfg(feature = "rustpython-compiler")]
|
||||
pub mod eval;
|
||||
mod exceptions;
|
||||
pub mod format;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#[cfg(feature = "rustpython_parser")]
|
||||
#[cfg(feature = "rustpython-parser")]
|
||||
mod ast;
|
||||
mod binascii;
|
||||
mod dis;
|
||||
@@ -6,7 +6,7 @@ mod hashlib;
|
||||
mod imp;
|
||||
mod itertools;
|
||||
mod json;
|
||||
#[cfg(feature = "rustpython_parser")]
|
||||
#[cfg(feature = "rustpython-parser")]
|
||||
mod keyword;
|
||||
mod marshal;
|
||||
mod math;
|
||||
@@ -18,7 +18,7 @@ pub mod socket;
|
||||
mod string;
|
||||
mod thread;
|
||||
mod time_module;
|
||||
#[cfg(feature = "rustpython_parser")]
|
||||
#[cfg(feature = "rustpython-parser")]
|
||||
mod tokenize;
|
||||
mod unicodedata;
|
||||
mod warnings;
|
||||
@@ -62,7 +62,7 @@ pub fn get_module_inits() -> HashMap<String, StdlibInitFunc> {
|
||||
};
|
||||
|
||||
// Insert parser related modules:
|
||||
#[cfg(feature = "rustpython_parser")]
|
||||
#[cfg(feature = "rustpython-parser")]
|
||||
{
|
||||
modules.insert(
|
||||
"ast".to_string(),
|
||||
|
||||
+4
-6
@@ -36,10 +36,8 @@ use crate::pyobject::{
|
||||
use crate::stdlib;
|
||||
use crate::sysmodule;
|
||||
use num_bigint::BigInt;
|
||||
#[cfg(feature = "rustpython_compiler")]
|
||||
use rustpython_compiler::compile;
|
||||
#[cfg(feature = "rustpython_compiler")]
|
||||
use rustpython_compiler::error::CompileError;
|
||||
#[cfg(feature = "rustpython-compiler")]
|
||||
use rustpython_compiler::{compile, error::CompileError};
|
||||
|
||||
// use objects::objects;
|
||||
|
||||
@@ -251,7 +249,7 @@ impl VirtualMachine {
|
||||
self.new_exception(overflow_error, msg)
|
||||
}
|
||||
|
||||
#[cfg(feature = "rustpython_compiler")]
|
||||
#[cfg(feature = "rustpython-compiler")]
|
||||
pub fn new_syntax_error(&self, error: &CompileError) -> PyObjectRef {
|
||||
let syntax_error_type = self.ctx.exceptions.syntax_error.clone();
|
||||
let syntax_error = self.new_exception(syntax_error_type, error.to_string());
|
||||
@@ -733,7 +731,7 @@ impl VirtualMachine {
|
||||
)
|
||||
}
|
||||
|
||||
#[cfg(feature = "rustpython_compiler")]
|
||||
#[cfg(feature = "rustpython-compiler")]
|
||||
pub fn compile(
|
||||
&self,
|
||||
source: &str,
|
||||
|
||||
+3
-3
@@ -11,9 +11,9 @@ edition = "2018"
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
|
||||
[dependencies]
|
||||
rustpython_compiler = { path = "../../compiler" }
|
||||
rustpython_parser = { path = "../../parser" }
|
||||
rustpython_vm = { path = "../../vm" }
|
||||
rustpython-compiler = { path = "../../compiler" }
|
||||
rustpython-parser = { path = "../../parser" }
|
||||
rustpython-vm = { path = "../../vm" }
|
||||
cfg-if = "0.1.2"
|
||||
wasm-bindgen = "0.2"
|
||||
wasm-bindgen-futures = "0.3"
|
||||
|
||||
Reference in new issue
Block a user