mirror of
https://github.com/ParkerTenBroeck/automata.git
synced 2026-06-07 05:28:45 -04:00
loading machines visually now downs
This commit is contained in:
parent
c57a95b7b5
commit
62cda62b31
7 changed files with 230 additions and 64 deletions
|
|
@ -169,15 +169,7 @@ pub fn compile(input: &str) -> CompileResult {
|
|||
let mut ctx = Context::new(input);
|
||||
let result = automata::loader::parse_universal(&mut ctx);
|
||||
|
||||
let graph = if let Some(result) = result {
|
||||
Some(match result {
|
||||
loader::Machine::Fa(fa) => serde_json::to_string(&fa).unwrap(),
|
||||
loader::Machine::Pda(pda) => serde_json::to_string(&pda).unwrap(),
|
||||
loader::Machine::Tm(tm) => serde_json::to_string(&tm).unwrap(),
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let graph = result.map(|result| serde_json::to_string(&result).unwrap());
|
||||
|
||||
use std::fmt::Write;
|
||||
let log_formatted = ctx.logs_display().fold(String::new(), |mut s, e| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue