mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-04 02:24:12 +02:00
update codegen
This commit is contained in:
parent
0d99a9510b
commit
b9c58b1adf
4 changed files with 389 additions and 468 deletions
|
|
@ -372,7 +372,7 @@ pub fn generate_game_events(demo: Demo) -> TokenStream {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_sizes() -> std::collections::hash_map::HashMap<&'static str, usize> {
|
||||
pub fn get_sizes() -> fnv::FnvHashMap<&'static str, usize> {
|
||||
vec![
|
||||
#(#sizes,)*
|
||||
].into_iter().collect()
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
|
|||
}
|
||||
let path = args[1].clone();
|
||||
let file = fs::read(path).expect("Unable to read file");
|
||||
let demo = Demo::new(file);
|
||||
let demo = Demo::new(&file);
|
||||
let tokens = generate_game_events(demo);
|
||||
let code = tokens.to_string();
|
||||
let formatted = format(&code)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue