<script>
import {createStateMachine} from "https://cdn.jsdelivr.net/npm/kingly@0.29.2/dist/kingly.es.js";
import AstDom from "./AstDom.svelte"
import properties from "./utils"
const {GIVEN_CLAUSE, COMMENT, TRANSITIONS_CLAUSE, WHEN_CLAUSE, THEN_CLAUSE, STATE, STATES_CLAUSE, COMPOUND_STATE_CLAUSE, STATE_IDENTIFIER_CLAUSE, GUARDED_TRANSITIONS_CLAUSE, GUARDED_TRANSITION_CLAUSE, UNGUARDED_TRANSITION_CLAUSE, JS_IDENTIFIER, EVENT} = properties;
function last(arr){return arr[arr.length - 1]}
function handleAstChange(newAst, newCursor){
astHistory.push(newAst);
cursor = newCursor;
// Required by Svelte's reactivity engine (specific to arrays)
astHistory = astHistory;
// This will hold history management
};
// TODO: this will be a mapping event -> actions to be precise
let behavior = {};
let astHistory = [];
let cursor = [];
$: ast = last(astHistory);
const astRoot = {
type: "root",
children: []
};
const ast1Comment = {
type: "root",
children: [
{
type: COMMENT,
comment: void 0,
children: []
}
]
}
const ast2Comments = {