changed how machines are parsed/represented

This commit is contained in:
ParkerTenBroeck 2026-01-09 20:13:09 -05:00
parent 132380e777
commit 34b20ec1fe
23 changed files with 1577 additions and 206 deletions

View file

@ -78,7 +78,11 @@ function buildAnalysis(text: string, doc: Text) {
const { log, log_formatted, graph } = compile(text);
if (graph){
setAutomaton(JSON.parse(graph))
try{
setAutomaton(JSON.parse(graph))
}catch(e){
console.log(e);
}
}
// Build ONE Decoration set: syntax + diagnostics

View file

@ -132,6 +132,7 @@ export function clearAutomaton() {
}
export function setAutomaton(auto: GraphDef) {
console.log(auto);
automaton = auto;
automaton.final_states = new Set(automaton.final_states)
automaton.states = new Set(automaton.states)