diff --git a/macros/src/lib.rs b/macros/src/lib.rs index eef96b71ae3914bb1ec3ecaf863e221aae1ab3c0..f488eb32c4c776939088b76da27cd4d55545b958 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -1,5 +1,5 @@ //! Procedural macros of the `cortex-m-rtfm` crate -#![deny(warnings)] +//#![deny(warnings)] #![feature(proc_macro)] #![recursion_limit = "128"] @@ -10,6 +10,9 @@ extern crate proc_macro; extern crate quote; extern crate rtfm_syntax as syntax; extern crate syn; +use std::fs::File; +use std::io::{Read, Write}; +use std::path::PathBuf; use proc_macro::TokenStream; use syntax::App; @@ -181,8 +184,17 @@ fn run(ts: TokenStream) -> Result<TokenStream> { let ownerships = analyze::app(&app); let tokens = trans::app(&app, &ownerships); - println!("here we are"); - println!("{:?}", app.tasks); + println!("tasks"); + let mut tasks = Vec::new(); + for (id, _task) in app.tasks { + println!("{}", id); + tasks.push(format!("{}", id)); + } + + let path = std::path::Path::new("klee/tasks.txt"); + + let mut file = File::create(path).unwrap(); + write!(file, "// autogenertated file \n {:?}", tasks).unwrap(); Ok(format!("{}", tokens) .parse() diff --git a/tasks.txt b/tasks.txt new file mode 100644 index 0000000000000000000000000000000000000000..6912017d71fc9d95e616250cc82796a8a22036dc --- /dev/null +++ b/tasks.txt @@ -0,0 +1,2 @@ +// autogenertated file + \ No newline at end of file