diff --git a/src/automata/npda.rs b/src/automata/npda.rs index 52af692..6519b32 100644 --- a/src/automata/npda.rs +++ b/src/automata/npda.rs @@ -211,8 +211,9 @@ impl Npda { State(0) } }; - if states.insert(ident, state).is_some() { + if let Some(old) = states.insert(ident, state) { ctx.emit_error("state redefined", item.1); + states.insert(ident, old); } } @@ -284,8 +285,9 @@ impl Npda { Symbol(0) } }; - if stack_symbols.insert(ident, symbol).is_some() { + if let Some(old) = stack_symbols.insert(ident, symbol) { ctx.emit_error("stack symbol redefined", item.1); + stack_symbols.insert(ident, old); } } diff --git a/web/root/assets/icon.jpg b/web/root/assets/icon.jpg new file mode 100644 index 0000000..f5d649c Binary files /dev/null and b/web/root/assets/icon.jpg differ diff --git a/web/root/index.html b/web/root/index.html index efb9044..7964d62 100644 --- a/web/root/index.html +++ b/web/root/index.html @@ -6,6 +6,7 @@ Automata + @@ -36,7 +37,7 @@
-
+