Skip to content

Commit

Permalink
serve strings in miniblock
Browse files Browse the repository at this point in the history
  • Loading branch information
cmontella committed Oct 1, 2020
1 parent d079c97 commit dd48efb
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/bin/mech.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
for block in blocks {
let mut miniblock = MiniBlock::new();
miniblock.transformations = block.transformations.clone();
for (k,v) in block.store.strings.iter() {
miniblock.strings.push((k.clone(), v.clone()));
}
miniblocks.push(miniblock);
}
let serialized_miniblocks: Vec<u8> = bincode::serialize(&miniblocks).unwrap();
Expand Down Expand Up @@ -655,22 +658,13 @@ let text_logo = r#"
│ │ │ │ │ │ │ ┌────┘ │ │ │ ┌─┘ │ │
│ │ └─┘ │ │ │ └────┐ │ └────┐ │ │ │ │
└─┘ └─┘ └──────┘ └──────┘ └─┘ └─┘"#.truecolor(246,192,78);

//println!(" {}", "╔═══════════════════════════════════════╗".bright_black());
//println!(" {} {} {}", "║".bright_black(), format!("v{}",version).truecolor(246,192,78), "║".bright_black());
//println!(" {} {} {}", "║".bright_black(), "www.mech-lang.org", "║".bright_black());
//println!(" {}\n", "╚═══════════════════════════════════════╝".bright_black());

// println!("Prepend commands with a colon. Enter :help to see a full list of commands. Enter :quit to quit.\n");
let help_message = r#"
Available commands are:
help - displays this message
quit - quits this REPL
core - prints info about the current mech core
runtime - prints info about the runtime attached to the current core
pause - pause core execution
resume - resume core execution
clear - reset the current core
"#;

Expand All @@ -679,6 +673,13 @@ clear - reset the current core
stdo.execute(cursor::MoveTo(0,0));
stdo.execute(Print(text_logo));
stdo.execute(cursor::MoveToNextLine(1));

println!(" {}", "╔═══════════════════════════════════════╗".bright_black());
println!(" {} {} {}", "║".bright_black(), format!("v{}",version).truecolor(246,192,78), "║".bright_black());
println!(" {} {} {}", "║".bright_black(), "www.mech-lang.org", "║".bright_black());
println!(" {}\n", "╚═══════════════════════════════════════╝".bright_black());

println!("Prepend commands with a colon. Enter :help to see a full list of commands. Enter :quit to quit.\n");
stdo.flush();


Expand Down

0 comments on commit dd48efb

Please sign in to comment.