Browse Source

Read from stdin

master
Colin Reeder 3 years ago
parent
commit
e86491a5ee
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/main.rs

+ 4
- 1
src/main.rs View File

@@ -87,7 +87,10 @@ fn native_to_rs(native: SplitTypeNative) -> &'static str {
}

fn main() {
let result = parser::TypeFileParser::new().parse("Test = uint8\nTestAgain = int32\nInterface = {hmm: uint32}").unwrap();
use std::io::Read;
let mut content = String::new();
std::io::stdin().read_to_string(&mut content).expect("Failed to read stdin");
let result = parser::TypeFileParser::new().parse(&content).unwrap();
for def in result {
match def.ty.into() {
SplitType::Interface(interface) => {


Loading…
Cancel
Save