Skip to content

Commit 6b018a0

Browse files
authored
Merge pull request RustPython#1096 from RustPython/underscore2hyphen
Underscore2hyphen
2 parents 96f6646 + 6a58b76 commit 6b018a0

File tree

15 files changed

+63
-68
lines changed

15 files changed

+63
-68
lines changed

Cargo.lock

+19-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustpython"
33
version = "0.0.1"
4-
authors = ["Windel Bouwman <windel@windel.nl>", "Shing Lyu <shing.lyu@gmail.com>"]
4+
authors = ["RustPython Team"]
55
edition = "2018"
66

77
[workspace]
@@ -16,9 +16,9 @@ path = "./benchmarks/bench.rs"
1616
log="0.4.1"
1717
env_logger="0.5.10"
1818
clap = "2.31.2"
19-
rustpython_compiler = {path = "compiler"}
20-
rustpython_parser = {path = "parser"}
21-
rustpython_vm = {path = "vm"}
19+
rustpython-compiler = {path = "compiler"}
20+
rustpython-parser = {path = "parser"}
21+
rustpython-vm = {path = "vm"}
2222
rustyline = "4.1.0"
2323
xdg = "2.2.0"
2424

bytecode/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
2-
name = "rustpython_bytecode"
2+
name = "rustpython-bytecode"
33
version = "0.1.0"
4-
authors = ["Windel Bouwman <windel@windel.nl>"]
4+
authors = ["RustPython Team"]
55
edition = "2018"
66

77
[dependencies]

compiler/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
2-
name = "rustpython_compiler"
2+
name = "rustpython-compiler"
33
version = "0.1.0"
4-
authors = ["coolreader18 <33094578+coolreader18@users.noreply.github.com>", "Windel Bouwman <windel@windel.nl>"]
4+
authors = ["RustPython Team"]
55
edition = "2018"
66

77
[dependencies]
8-
rustpython_bytecode = { path = "../bytecode" }
9-
rustpython_parser = { path = "../parser" }
8+
rustpython-bytecode = { path = "../bytecode" }
9+
rustpython-parser = { path = "../parser" }
1010
num-complex = { version = "0.2", features = ["serde"] }
1111
log = "0.3"

derive/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
2-
name = "rustpython_derive"
2+
name = "rustpython-derive"
33
version = "0.1.0"
4-
authors = ["Joey <jmhain@protonmail.com>"]
4+
authors = ["RustPython Team"]
55
edition = "2018"
66

77
[lib]
@@ -11,7 +11,7 @@ proc-macro = true
1111
syn = { version = "0.15.29", features = ["full"] }
1212
quote = "0.6.11"
1313
proc-macro2 = "0.4.27"
14-
rustpython_compiler = { path = "../compiler" }
15-
rustpython_bytecode = { path = "../bytecode" }
14+
rustpython-compiler = { path = "../compiler" }
15+
rustpython-bytecode = { path = "../bytecode" }
1616
bincode = "1.1"
1717
proc-macro-hack = "0.5"

parser/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
2-
name = "rustpython_parser"
2+
name = "rustpython-parser"
33
version = "0.0.1"
4-
authors = [ "Shing Lyu", "Windel Bouwman" ]
4+
authors = [ "RustPython Team" ]
55
build = "build.rs"
66
edition = "2018"
77

parser/src/parser.rs

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ pub fn parse_statement(source: &str) -> Result<Vec<ast::LocatedStatement>, Parse
4444
/// # Example
4545
/// ```
4646
/// extern crate num_bigint;
47-
/// extern crate rustpython_parser;
4847
/// use num_bigint::BigInt;
4948
/// use rustpython_parser::{parser, ast};
5049
/// let expr = parser::parse_expression("1+2").unwrap();

src/main.rs

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ extern crate clap;
33
extern crate env_logger;
44
#[macro_use]
55
extern crate log;
6-
extern crate rustpython_parser;
7-
extern crate rustpython_vm;
86
extern crate rustyline;
97

108
use clap::{App, Arg};

vm/Cargo.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
2-
name = "rustpython_vm"
2+
name = "rustpython-vm"
33
version = "0.1.0"
4-
authors = ["Shing Lyu <shing.lyu@gmail.com>"]
4+
authors = ["RustPython Team"]
55
edition = "2018"
66

77
[features]
8-
default = ["rustpython_parser", "rustpython_compiler"]
8+
default = ["rustpython-parser", "rustpython-compiler"]
99

1010
[dependencies]
1111
# Crypto:
@@ -23,10 +23,10 @@ num-integer = "0.1.39"
2323
num-rational = "0.2.1"
2424
rand = "0.5"
2525
log = "0.3"
26-
rustpython_derive = {path = "../derive"}
27-
rustpython_parser = {path = "../parser", optional = true}
28-
rustpython_compiler = {path = "../compiler", optional = true}
29-
rustpython_bytecode = { path = "../bytecode" }
26+
rustpython-derive = {path = "../derive"}
27+
rustpython-parser = {path = "../parser", optional = true}
28+
rustpython-compiler = {path = "../compiler", optional = true}
29+
rustpython-bytecode = { path = "../bytecode" }
3030
serde = { version = "1.0.66", features = ["derive"] }
3131
serde_json = "1.0.26"
3232
byteorder = "1.2.6"

vm/src/builtins.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::obj::objint::{self, PyIntRef};
1818
use crate::obj::objiter;
1919
use crate::obj::objstr::{self, PyString, PyStringRef};
2020
use crate::obj::objtype::{self, PyClassRef};
21-
#[cfg(feature = "rustpython_compiler")]
21+
#[cfg(feature = "rustpython-compiler")]
2222
use rustpython_compiler::compile;
2323

2424
use crate::frame::Scope;
@@ -99,7 +99,7 @@ struct CompileArgs {
9999
optimize: OptionalArg<PyIntRef>,
100100
}
101101

102-
#[cfg(feature = "rustpython_compiler")]
102+
#[cfg(feature = "rustpython-compiler")]
103103
fn builtin_compile(args: CompileArgs, vm: &VirtualMachine) -> PyResult<PyCodeRef> {
104104
// TODO: compile::compile should probably get bytes
105105
let source = match args.source {
@@ -155,7 +155,7 @@ fn builtin_divmod(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult {
155155

156156
/// Implements `eval`.
157157
/// See also: https://docs.python.org/3/library/functions.html#eval
158-
#[cfg(feature = "rustpython_compiler")]
158+
#[cfg(feature = "rustpython-compiler")]
159159
fn builtin_eval(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult {
160160
// TODO: support any mapping for `locals`
161161
arg_check!(
@@ -187,7 +187,7 @@ fn builtin_eval(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult {
187187

188188
/// Implements `exec`
189189
/// https://docs.python.org/3/library/functions.html#exec
190-
#[cfg(feature = "rustpython_compiler")]
190+
#[cfg(feature = "rustpython-compiler")]
191191
fn builtin_exec(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult {
192192
arg_check!(
193193
vm,
@@ -789,7 +789,7 @@ pub fn make_module(vm: &VirtualMachine, module: PyObjectRef) {
789789
#[cfg(not(target_arch = "wasm32"))]
790790
let open = vm.ctx.new_rustfunc(io_open);
791791

792-
#[cfg(feature = "rustpython_compiler")]
792+
#[cfg(feature = "rustpython-compiler")]
793793
{
794794
extend_module!(vm, module, {
795795
"compile" => ctx.new_rustfunc(builtin_compile),

vm/src/import.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::obj::{objcode, objsequence, objstr};
1010
use crate::pyobject::{ItemProtocol, PyResult, PyValue};
1111
use crate::util;
1212
use crate::vm::VirtualMachine;
13-
#[cfg(feature = "rustpython_compiler")]
13+
#[cfg(feature = "rustpython-compiler")]
1414
use rustpython_compiler::compile;
1515

1616
pub fn init_importlib(vm: &VirtualMachine) -> PyResult {
@@ -57,7 +57,7 @@ pub fn import_module(vm: &VirtualMachine, current_path: PathBuf, module_name: &s
5757
import_frozen(vm, module_name)
5858
} else if vm.stdlib_inits.borrow().contains_key(module_name) {
5959
import_builtin(vm, module_name)
60-
} else if cfg!(feature = "rustpython_compiler") {
60+
} else if cfg!(feature = "rustpython-compiler") {
6161
let notfound_error = &vm.ctx.exceptions.module_not_found_error;
6262
let import_error = &vm.ctx.exceptions.import_error;
6363

@@ -79,7 +79,7 @@ pub fn import_module(vm: &VirtualMachine, current_path: PathBuf, module_name: &s
7979
}
8080
}
8181

82-
#[cfg(feature = "rustpython_compiler")]
82+
#[cfg(feature = "rustpython-compiler")]
8383
pub fn import_file(
8484
vm: &VirtualMachine,
8585
module_name: &str,

vm/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub mod macros;
4444
mod builtins;
4545
pub mod cformat;
4646
mod dictdatatype;
47-
#[cfg(feature = "rustpython_compiler")]
47+
#[cfg(feature = "rustpython-compiler")]
4848
pub mod eval;
4949
mod exceptions;
5050
pub mod format;

vm/src/stdlib/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#[cfg(feature = "rustpython_parser")]
1+
#[cfg(feature = "rustpython-parser")]
22
mod ast;
33
mod binascii;
44
mod dis;
55
mod hashlib;
66
mod imp;
77
mod itertools;
88
mod json;
9-
#[cfg(feature = "rustpython_parser")]
9+
#[cfg(feature = "rustpython-parser")]
1010
mod keyword;
1111
mod marshal;
1212
mod math;
@@ -18,7 +18,7 @@ pub mod socket;
1818
mod string;
1919
mod thread;
2020
mod time_module;
21-
#[cfg(feature = "rustpython_parser")]
21+
#[cfg(feature = "rustpython-parser")]
2222
mod tokenize;
2323
mod unicodedata;
2424
mod warnings;
@@ -62,7 +62,7 @@ pub fn get_module_inits() -> HashMap<String, StdlibInitFunc> {
6262
};
6363

6464
// Insert parser related modules:
65-
#[cfg(feature = "rustpython_parser")]
65+
#[cfg(feature = "rustpython-parser")]
6666
{
6767
modules.insert(
6868
"ast".to_string(),

vm/src/vm.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ use crate::pyobject::{
3636
use crate::stdlib;
3737
use crate::sysmodule;
3838
use num_bigint::BigInt;
39-
#[cfg(feature = "rustpython_compiler")]
40-
use rustpython_compiler::compile;
41-
#[cfg(feature = "rustpython_compiler")]
42-
use rustpython_compiler::error::CompileError;
39+
#[cfg(feature = "rustpython-compiler")]
40+
use rustpython_compiler::{compile, error::CompileError};
4341

4442
// use objects::objects;
4543

@@ -251,7 +249,7 @@ impl VirtualMachine {
251249
self.new_exception(overflow_error, msg)
252250
}
253251

254-
#[cfg(feature = "rustpython_compiler")]
252+
#[cfg(feature = "rustpython-compiler")]
255253
pub fn new_syntax_error(&self, error: &CompileError) -> PyObjectRef {
256254
let syntax_error_type = self.ctx.exceptions.syntax_error.clone();
257255
let syntax_error = self.new_exception(syntax_error_type, error.to_string());
@@ -733,7 +731,7 @@ impl VirtualMachine {
733731
)
734732
}
735733

736-
#[cfg(feature = "rustpython_compiler")]
734+
#[cfg(feature = "rustpython-compiler")]
737735
pub fn compile(
738736
&self,
739737
source: &str,

wasm/lib/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustpython_wasm"
33
version = "0.1.0-pre-alpha.2"
4-
authors = ["Ryan Liddle <ryan@rmliddle.com>"]
4+
authors = ["RustPython Team"]
55
license = "MIT"
66
description = "A Python-3 (CPython >= 3.5.0) Interpreter written in Rust, compiled to WASM"
77
repository = "https://github.com/RustPython/RustPython/tree/master/wasm/lib"
@@ -11,9 +11,9 @@ edition = "2018"
1111
crate-type = ["cdylib", "rlib"]
1212

1313
[dependencies]
14-
rustpython_compiler = { path = "../../compiler" }
15-
rustpython_parser = { path = "../../parser" }
16-
rustpython_vm = { path = "../../vm" }
14+
rustpython-compiler = { path = "../../compiler" }
15+
rustpython-parser = { path = "../../parser" }
16+
rustpython-vm = { path = "../../vm" }
1717
cfg-if = "0.1.2"
1818
wasm-bindgen = "0.2"
1919
wasm-bindgen-futures = "0.3"

0 commit comments

Comments
 (0)