Skip to content

Underscore2hyphen #1096

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 3, 2019
Merged
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
38 changes: 19 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "rustpython"
version = "0.0.1"
authors = ["Windel Bouwman <windel@windel.nl>", "Shing Lyu <shing.lyu@gmail.com>"]
authors = ["RustPython Team"]
edition = "2018"

[workspace]
Expand All @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions bytecode/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "rustpython_bytecode"
name = "rustpython-bytecode"
version = "0.1.0"
authors = ["Windel Bouwman <windel@windel.nl>"]
authors = ["RustPython Team"]
edition = "2018"

[dependencies]
Expand Down
8 changes: 4 additions & 4 deletions compiler/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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>"]
authors = ["RustPython Team"]
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"
8 changes: 4 additions & 4 deletions derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "rustpython_derive"
name = "rustpython-derive"
version = "0.1.0"
authors = ["Joey <jmhain@protonmail.com>"]
authors = ["RustPython Team"]
edition = "2018"

[lib]
Expand All @@ -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"
4 changes: 2 additions & 2 deletions parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "rustpython_parser"
name = "rustpython-parser"
version = "0.0.1"
authors = [ "Shing Lyu", "Windel Bouwman" ]
authors = [ "RustPython Team" ]
build = "build.rs"
edition = "2018"

Expand Down
1 change: 0 additions & 1 deletion parser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 0 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
14 changes: 7 additions & 7 deletions vm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "rustpython_vm"
name = "rustpython-vm"
version = "0.1.0"
authors = ["Shing Lyu <shing.lyu@gmail.com>"]
authors = ["RustPython Team"]
edition = "2018"

[features]
default = ["rustpython_parser", "rustpython_compiler"]
default = ["rustpython-parser", "rustpython-compiler"]

[dependencies]
# Crypto:
Expand All @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions vm/src/builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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!(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions vm/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;

Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion vm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions vm/src/stdlib/mod.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#[cfg(feature = "rustpython_parser")]
#[cfg(feature = "rustpython-parser")]
mod ast;
mod binascii;
mod dis;
mod hashlib;
mod imp;
mod itertools;
mod json;
#[cfg(feature = "rustpython_parser")]
#[cfg(feature = "rustpython-parser")]
mod keyword;
mod marshal;
mod math;
Expand All @@ -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;
Expand Down Expand Up @@ -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(),
Expand Down
10 changes: 4 additions & 6 deletions vm/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -733,7 +731,7 @@ impl VirtualMachine {
)
}

#[cfg(feature = "rustpython_compiler")]
#[cfg(feature = "rustpython-compiler")]
pub fn compile(
&self,
source: &str,
Expand Down
8 changes: 4 additions & 4 deletions wasm/lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "rustpython_wasm"
version = "0.1.0-pre-alpha.2"
authors = ["Ryan Liddle <ryan@rmliddle.com>"]
authors = ["RustPython Team"]
license = "MIT"
description = "A Python-3 (CPython >= 3.5.0) Interpreter written in Rust, compiled to WASM"
repository = "https://github.com/RustPython/RustPython/tree/master/wasm/lib"
Expand All @@ -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"
Expand Down