Skip to content

Commit 17c036f

Browse files
committed
Rename crates for consistency
rust-ast-builder -> c2rust-ast-builder ast-exporter -> c2rust-ast-exporter rust-refactor -> c2rust-refactor transpiler -> c2rust-transpiler All references to these names are updated (hopefully).
1 parent db832fb commit 17c036f

File tree

345 files changed

+200
-1399
lines changed

Some content is hidden

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

345 files changed

+200
-1399
lines changed

README.md

Lines changed: 2 additions & 2 deletions

rust-ast-builder/Cargo.toml renamed to c2rust-ast-builder/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "rust_ast_builder"
2+
name = "c2rust-ast-builder"
33
version = "0.1.0"
44
authors = ["Eric Mertens <[email protected]>"]
55

File renamed without changes.
File renamed without changes.

ast-exporter/Cargo.toml renamed to c2rust-ast-exporter/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "ast_exporter"
2+
name = "c2rust-ast-exporter"
33
version = "0.1.0"
44
authors = [
55
"Eric Mertens <[email protected]>",
File renamed without changes.

ast-exporter/src/AstExporter.cpp renamed to c2rust-ast-exporter/src/AstExporter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ using namespace llvm;
3333
using namespace clang;
3434
using namespace clang::tooling;
3535

36-
#define DEBUG_TYPE "ast-exporter"
36+
#define DEBUG_TYPE "c2rust-ast-exporter"
3737

3838
#ifndef LLVM_DEBUG
3939
#define LLVM_DEBUG DEBUG

ast-exporter/src/CMakeLists.txt renamed to c2rust-ast-exporter/src/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,19 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
5858
#################################################
5959

6060
# The executable
61-
add_executable(ast-exporter
61+
add_executable(c2rust-ast-exporter
6262
AstExporter.cpp
6363
FloatingLexer.cpp
6464
ExportResult.cpp
6565
Main.cpp
6666
)
67-
set_target_properties(ast-exporter PROPERTIES
67+
set_target_properties(c2rust-ast-exporter PROPERTIES
6868
CXX_STANDARD 11
6969
CXX_EXTENSIONS OFF
7070
)
71-
# PRIVATE was added to make ast-exporter build with LLVM 6.0. Keyword
71+
# PRIVATE was added to make c2rust-ast-exporter build with LLVM 6.0. Keyword
7272
# description: https://cmake.org/pipermail/cmake/2016-May/063400.html
73-
target_link_libraries(ast-exporter PRIVATE
73+
target_link_libraries(c2rust-ast-exporter PRIVATE
7474
clangAST
7575
clangFrontend
7676
clangTooling
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

rust-refactor/.gitignore renamed to c2rust-refactor/.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/idiomize
2-
/idiomize.d
1+
/c2rust-refactor
2+
/c2rust-refactor.d
33
__pycache__/
44
*.inc.rs
55
/target/
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "idiomize"
2+
name = "c2rust-refactor"
33
version = "0.1.0"
44
authors = ["Stuart Pernsteiner <[email protected]>"]
55
build = "build.rs"
@@ -11,13 +11,13 @@ libc = "0.2.28"
1111
getopts = "0.2.14"
1212
regex = "0.2.2"
1313
ena = "0.7.3"
14-
rust_ast_builder = { path = "../rust-ast-builder" }
14+
c2rust-ast-builder = { path = "../c2rust-ast-builder" }
1515
cargo = "0.30.0"
1616

1717
[lib]
18-
name = "idiomize"
18+
name = "c2rust_refactor"
1919
path = "src/lib.rs"
2020

2121
[[bin]]
22-
name = "idiomize"
22+
name = "c2rust-refactor"
2323
doc = false

rust-refactor/PLUGINS.txt renamed to c2rust-refactor/PLUGINS.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
`idiomize` has a simple plugin system, which is useful for mitigating the long compile times of the main `idiomize` binary.
1+
`c2rust-refactor` has a simple plugin system, which is useful for mitigating the long compile times of the main `c2rust-refactor` binary.
22

33

44
# Plugin API
@@ -7,9 +7,9 @@ A plugin is simply a shared library that provides a function with the following
77
signature:
88

99
#[no_mangle]
10-
pub fn register_commands(reg: &mut idiomize::command::Registry) { ... }
10+
pub fn register_commands(reg: &mut c2rust_refactor::command::Registry) { ... }
1111

12-
`idiomize` will call the `register_commands` function when the plugin is
12+
`c2rust-refactor` will call the `register_commands` function when the plugin is
1313
loaded, allowing it to add its commands to the command registry. Those
1414
commands will be available from the command line and editor integration, just
1515
like any built-in command.
@@ -23,7 +23,7 @@ Compile with a command like the following:
2323
rustc plugin_stub.rs \
2424
--crate-type dylib \
2525
-L target/debug/deps \
26-
--extern idiomize=target/debug/libidiomize.rlib \
26+
--extern c2rust_refactor=target/debug/libc2rust_refactor.rlib \
2727
--extern log=target/debug/deps/liblog-d13cea69eadf9021.rlib \
2828
--extern libc=target/debug/deps/liblibc-245f0779ba681f77.rlib
2929
```
@@ -35,7 +35,7 @@ the right hash.
3535

3636
# Loading plugins
3737

38-
First, pass `idiomize` the `-P path` option to add a directory to the plugin
38+
First, pass `c2rust_refactor` the `-P path` option to add a directory to the plugin
3939
search path. (The search path is empty by default, so no plugins can be
4040
loaded.) Then pass one or more `-p plugin_name` name options, to load
4141
`libplugin_name.so` for each option.

rust-refactor/README.md renamed to c2rust-refactor/README.md

Lines changed: 8 additions & 8 deletions
File renamed without changes.
File renamed without changes.
File renamed without changes.

rust-refactor/editor/vim8.vim renamed to c2rust-refactor/editor/vim8.vim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ function! s:ModeBegin()
1515
end
1616

1717
let s:job = job_start("./run-interact.sh",
18-
\ {"out_cb": "IdiomizeOutputHandler",
19-
\ "err_cb": "IdiomizeErrorHandler",
18+
\ {"out_cb": "RefactorOutputHandler",
19+
\ "err_cb": "RefactorErrorHandler",
2020
\
2121
\ "out_io": "buffer",
2222
\ "out_name": "<stdout>",
@@ -131,7 +131,7 @@ function! s:SetMark(mark, file, line, col)
131131
call setpos(a:mark, [nr, a:line, a:col, a:col])
132132
endfunction
133133

134-
function! IdiomizeOutputHandler(channel, msg)
134+
function! RefactorOutputHandler(channel, msg)
135135
let json = json_decode(a:msg)
136136
if json["msg"] == "mark"
137137
call s:HighlightMark(json["info"])
@@ -177,14 +177,14 @@ function! IdiomizeOutputHandler(channel, msg)
177177
endif
178178
endfunction
179179

180-
function! IdiomizeErrorHandler(channel, msg)
180+
function! RefactorErrorHandler(channel, msg)
181181
"echohl WarningMsg
182182
"echom a:msg
183183
"echohl None
184184
endfunction
185185

186186

187-
hi default IdiomizeMarkedNode ctermbg=52
187+
hi default RefactorMarkedNode ctermbg=52
188188

189189
function! s:HighlightMark(json)
190190
call s:SetMark("'<", a:json["file"], a:json["start_line"], a:json["start_col"] + 1)
@@ -206,7 +206,7 @@ function! s:Highlight(nr, line1, col1, line2, col2)
206206
let pat = '\%' . a:line1 . 'l\%' . a:col1 . 'c\_.*' .
207207
\ '\%' . a:line2 . 'l\%' . a:col2 . 'c'
208208
let hl = {
209-
\ 'group': 'IdiomizeMarkedNode',
209+
\ 'group': 'RefactorMarkedNode',
210210
\ 'pattern': pat,
211211
\ 'priority': 10,
212212
\ 'id': len(s:hl_map[a:nr]) + 4
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

rust-refactor/misc/rustfmt-clean-parens.diff renamed to c2rust-refactor/misc/rustfmt-clean-parens.diff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
This is a patch to `rustfmt` that adds a `clean_parens` option, which removes
22
unnecessary parentheses in exprs. I originally wrote this because the rewriter
3-
in `idiomize` would insert unnecessary parentheses around (at least) every
3+
in `c2rust-refactor` would insert unnecessary parentheses around (at least) every
44
splice point, and this seemed like the easiest way to clean it up. The
55
approach taken here involves some ugly hacks (see the `ExprKind::Paren` case
66
below), so it's probably not suitable for upstreaming in its current form. I
7-
think this patch is now obsolete, thanks to improvemens in the `idiomize`
7+
think this patch is now obsolete, thanks to improvemens in the `c2rust-refactor`
88
rewriter, but I'm leaving a copy here anyway in case it turns out to be useful.
99

1010

rust-refactor/plugin_stub.rs renamed to c2rust-refactor/plugin_stub.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! A generic wrapper for building parts of `idiomize` as a plugin.
1+
//! A generic wrapper for building parts of `c2rust-refactor` as a plugin.
22
33
#![feature(
44
i128_type,
@@ -23,15 +23,15 @@ extern crate syntax;
2323
extern crate syntax_ext;
2424
extern crate syntax_pos;
2525

26-
#[macro_use] extern crate idiomize;
27-
pub use idiomize::*;
26+
#[macro_use] extern crate c2rust_refactor;
27+
pub use c2rust_refactor::*;
2828

2929

3030
fn mk<T: transform::Transform + 'static>(t: T) -> Box<command::Command> {
3131
Box::new(transform::TransformCommand(t))
3232
}
3333

34-
// Adjust these lines to control what part of `idiomize` gets built.
34+
// Adjust these lines to control what part of `c2rust-refactor` gets built.
3535
//#[path="src/analysis/mod.rs"]
3636
#[path="src/transform/retype.rs"]
3737
mod plugin;
File renamed without changes.
File renamed without changes.

rust-refactor/scripts/lh_table_counter_cell.rs renamed to c2rust-refactor/scripts/lh_table_counter_cell.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
rustc_private,
44
trace_macros,
55
)]
6-
#[macro_use] extern crate idiomize;
6+
#[macro_use] extern crate c2rust_refactor;
77

8-
use idiomize::command::{Registry, FuncCommand, RefactorState};
8+
use c2rust_refactor::command::{Registry, FuncCommand, RefactorState};
99

1010
fn mark_fields(state: &mut RefactorState) {
1111
state.run("select", &["dummy",

rust-refactor/src/analysis/mod.rs renamed to c2rust-refactor/src/analysis/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::collections::HashSet;
44

55
use command::{Registry, DriverCommand};
66
use driver::Phase;
7-
use rust_ast_builder::IntoSymbol;
7+
use c2rust_ast_builder::IntoSymbol;
88

99

1010
pub mod labeled_ty;

rust-refactor/src/api.rs renamed to c2rust-refactor/src/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use syntax::ast::{Path, QSelf};
1515
pub use ast_manip::*;
1616
pub use ast_manip::fn_edit::{fold_fns, fold_fns_multi};
1717
pub use ast_manip::lr_expr::fold_expr_with_context;
18-
pub use rust_ast_builder::mk;
18+
pub use c2rust_ast_builder::mk;
1919
pub use driver::{parse_expr, parse_pat, parse_ty, parse_stmts, parse_items};
2020
pub use matcher::{MatchCtxt, Bindings, BindingType, Subst};
2121
pub use matcher::{fold_match, fold_match_with};

rust-refactor/src/collapse/macros.rs renamed to c2rust-refactor/src/collapse/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use syntax::ptr::P;
77
use syntax::parse::token::{Token, Nonterminal};
88
use syntax::tokenstream::{self, TokenStream, ThinTokenStream, TokenTree, Delimited};
99
use smallvec::SmallVec;
10-
use rust_ast_builder::mk;
10+
use c2rust_ast_builder::mk;
1111

1212
use super::mac_table::{MacTable, InvocId, InvocKind};
1313
use super::nt_match::{self, NtMatch};

rust-refactor/src/collapse/mod.rs renamed to c2rust-refactor/src/collapse/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::collections::HashSet;
22
use syntax::attr;
33
use syntax::ast::*;
44
use syntax::source_map::Span;
5-
use rust_ast_builder::IntoSymbol;
5+
use c2rust_ast_builder::IntoSymbol;
66

77
mod cfg_attr;
88
mod mac_table;

rust-refactor/src/collapse/nt_match.rs renamed to c2rust-refactor/src/collapse/nt_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_target::spec::abi::Abi;
99

1010
use std::rc::Rc;
1111
use syntax::ptr::P;
12-
use rust_ast_builder::mk;
12+
use c2rust_ast_builder::mk;
1313

1414
use ast_manip::{MaybeGetNodeId, GetSpan};
1515

rust-refactor/src/command.rs renamed to c2rust-refactor/src/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use node_map::NodeMap;
2424
use rewrite;
2525
use rewrite::files;
2626
use span_fix;
27-
use rust_ast_builder::IntoSymbol;
27+
use c2rust_ast_builder::IntoSymbol;
2828

2929

3030
/// Extra nodes that were parsed from strings while running a transformation pass. During

rust-refactor/src/contains_mark.rs renamed to c2rust-refactor/src/contains_mark.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use syntax::visit::{self, Visitor};
55

66
use ast_manip::Visit;
77
use command::CommandState;
8-
use rust_ast_builder::IntoSymbol;
8+
use c2rust_ast_builder::IntoSymbol;
99

1010

1111

rust-refactor/src/driver.rs renamed to c2rust-refactor/src/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ impl Phase1Bits {
217217

218218
/// Sysroot adjustment: if the sysroot is unset, and args[0] is an absolute path, use args[0] to
219219
/// infer a sysroot. Rustc's own sysroot detection (filesearch::get_or_default_sysroot) uses
220-
/// env::current_exe, which will point to idiomize, not rustc.
220+
/// env::current_exe, which will point to c2rust-refactor, not rustc.
221221
fn maybe_set_sysroot(mut sopts: Options, args: &[String]) -> Options {
222222
if sopts.maybe_sysroot.is_none() && args.len() > 0 {
223223
let p = Path::new(&args[0]);
File renamed without changes.

rust-refactor/src/interact/main_thread.rs renamed to c2rust-refactor/src/interact/main_thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use interact::WrapSender;
2626
use interact::{plain_backend, vim8_backend};
2727
use interact::worker::{self, ToWorker};
2828
use pick_node;
29-
use rust_ast_builder::IntoSymbol;
29+
use c2rust_ast_builder::IntoSymbol;
3030

3131
use super::MarkInfo;
3232

rust-refactor/src/interact/mod.rs renamed to c2rust-refactor/src/interact/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Interactive mode, for running `idiomize` as a backend for editor plugins.
1+
//! Interactive mode, for running `c2rust-refactor` as a backend for editor plugins.
22
use std::marker::PhantomData;
33
use std::sync::mpsc::{SyncSender, SendError};
44

rust-refactor/src/lib.rs renamed to c2rust-refactor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ extern crate rustc_codegen_utils;
2121
extern crate syntax;
2222
extern crate syntax_ext;
2323
extern crate syntax_pos;
24-
extern crate rust_ast_builder;
24+
extern crate c2rust_ast_builder;
2525

2626
#[macro_use] mod macros;
2727

File renamed without changes.

0 commit comments

Comments
 (0)