fixed npda crash on duplicate states/symbols, reduced font size for edges, fixed incorrect caret color, fixed edge label alignment

This commit is contained in:
ParkerTenBroeck 2026-01-08 19:00:14 -05:00
parent 13bcab9cd1
commit 47d7482342
5 changed files with 35 additions and 24 deletions

View file

@ -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);
}
}