import type { EditorState } from "./Editor"; export const initialEditorState: EditorState = { kind: "input", text: "", value: { kind: "text" }, focus: true, }; export const nonEmptyEditorState: EditorState = { kind: "call", fn: { kind: "call", fn: { kind: "input", text: "list.push", value: { kind: "name" }, focus: false, }, input: { kind: "input", text: "list.emptyList", value: { kind: "name" }, focus: false, }, }, input: { kind: "input", text: "42", value: { kind: "literal", type: "Int" }, focus: false, }, }; export const tripleFunctionCallEditorState: EditorState = { kind: "call", fn: { kind: "call", fn: { kind: "call", fn: { kind: "call", fn: { kind: "input", text: "functionWith4Params", value: { kind: "name" }, focus: false, }, input: { kind: "input", text: "42", value: { kind: "literal", type: "Int" }, focus: false, }, }, input: { kind: "input", text: "43", value: { kind: "literal", type: "Int" }, focus: false, }, }, input: { kind: "input", text: "44", value: { kind: "literal", type: "Int" }, focus: false, }, }, input: { kind: "input", text: "45", value: { kind: "literal", type: "Int" }, focus: false, }, }; export const biggerExample: EditorState = { "kind": "let", "inner": { "kind": "let", "inner": { "kind": "let", "inner": { "kind": "let", "inner": { "kind": "input", "text": "", "value": { "kind": "text" }, "focus": false }, "name": "myListInc", "value": { "kind": "call", "fn": { "kind": "call", "fn": { "kind": "input", "text": "list.map", "value": { "kind": "name" }, "focus": false }, "input": { "kind": "input", "text": "myList", "value": { "kind": "name" }, "focus": false } }, "input": { "kind": "input", "text": "inc", "value": { "kind": "name" }, "focus": false } } }, "name": "myList", "value": { "kind": "call", "fn": { "kind": "call", "fn": { "kind": "input", "text": "list.push", "value": { "kind": "name" }, "focus": false }, "input": { "kind": "call", "fn": { "kind": "call", "fn": { "kind": "input", "text": "list.push", "value": { "kind": "name" }, "focus": false }, "input": { "kind": "call", "fn": { "kind": "call", "fn": { "kind": "input", "text": "list.push", "value": { "kind": "name" }, "focus": false }, "input": { "kind": "input", "text": "list.emptyList", "value": { "kind": "name" }, "focus": false } }, "input": { "kind": "input", "text": "1", "value": { "kind": "literal", "type": "Int" }, "focus": false } } }, "input": { "kind": "input", "text": "2", "value": { "kind": "literal", "type": "Int" }, "focus": false } } }, "input": { "kind": "input", "text": "3", "value": { "kind": "literal", "type": "Int" }, "focus": false } } }, "name": "id", "value": { "kind": "lambda", "paramName": "x", "expr": { "kind": "input", "text": "x", "value": { "kind": "name" }, "focus": false } } }, "name": "inc", "value": { "kind": "lambda", "paramName": "x", "expr": { "kind": "call", "fn": { "kind": "call", "fn": { "kind": "input", "text": "addInt", "value": { "kind": "name" }, "focus": false }, "input": { "kind": "input", "text": "x", "value": { "kind": "name" }, "focus": false } }, "input": { "kind": "input", "text": "1", "value": { "kind": "literal", "type": "Int" }, "focus": true } } } };