mirror of
https://github.com/ParkerTenBroeck/automata.git
synced 2026-06-06 21:24:06 -04:00
changed how machines are parsed/represented
This commit is contained in:
parent
132380e777
commit
34b20ec1fe
23 changed files with 1577 additions and 206 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue