Hasty sketch at rust demangling (work in progress); c.f #213

This commit is contained in:
Matt Godbolt 2016-12-22 16:10:37 -06:00
parent dadf9c2d85
commit 73880b9033
4 changed files with 43 additions and 0 deletions

1
rust/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
target

14
rust/Cargo.lock generated Normal file
View File

@ -0,0 +1,14 @@
[root]
name = "rustfilt"
version = "0.1.0"
dependencies = [
"rustc-demangle 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-demangle"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
"checksum rustc-demangle 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1430d286cadb237c17c885e25447c982c97113926bb579f4379c0eca8d9586dc"

7
rust/Cargo.toml Normal file
View File

@ -0,0 +1,7 @@
[package]
name = "rustfilt"
version = "0.1.0"
authors = ["Matt Godbolt <matt@godbolt.org>"]
[dependencies]
rustc-demangle = "*"

21
rust/src/main.rs Normal file
View File

@ -0,0 +1,21 @@
use std::io;
use std::io::prelude::*;
use rustc_demangle::demangle;
extern crate rustc_demangle;
fn main() {
let stdin = io::stdin();
for line in stdin.lock().lines() {
let a = line.unwrap();
println!("{}", demangle(&a));
}
/*
let var: Vec<String> = input.split(' ')
.into_iter()
.map(|x| demangle(x).to_string())
.collect();
println!("{}", var.join(" "));
*/
}