diff --git a/src/components/Statement.vue b/src/components/Statement.vue
index 05b4a2e..9812305 100644
--- a/src/components/Statement.vue
+++ b/src/components/Statement.vue
@@ -36,14 +36,6 @@ computed(() => value = getValueStatement())
.sidebar {
padding-left: 10px;
}
-
- .edit-button {
- border: none;
- }
-
- .edit-button:hover {
- cursor: pointer;
- }
@@ -56,9 +48,18 @@ computed(() => value = getValueStatement())
diff --git a/src/components/TextBox.vue b/src/components/TextBox.vue
index 80216ac..59bea62 100644
--- a/src/components/TextBox.vue
+++ b/src/components/TextBox.vue
@@ -25,12 +25,12 @@ const props = defineProps({
$emit('edit')"
- >EditEdit
$emit('remove')"
- >RemoveRemove
diff --git a/src/pages/Editor.vue b/src/pages/Editor.vue
index 5bc9b99..c782304 100644
--- a/src/pages/Editor.vue
+++ b/src/pages/Editor.vue
@@ -1,17 +1,15 @@
diff --git a/src/pages/VarDeclEditor.vue b/src/pages/VarDeclEditor.vue
index a8f545f..0d5f914 100644
--- a/src/pages/VarDeclEditor.vue
+++ b/src/pages/VarDeclEditor.vue
@@ -1,10 +1,14 @@
diff --git a/src/support/page.ts b/src/support/page.ts
index b4e60fa..1214755 100644
--- a/src/support/page.ts
+++ b/src/support/page.ts
@@ -21,6 +21,11 @@ export class MathPage {
return Object.values(this.statements)
}
+ /** Remove a statement from the math page. */
+ removeStatement(id: StatementID) {
+ delete this.statements[id]
+ }
+
/** Get a statement by ID if it exists. */
getStatement(id: StatementID): Maybe {
return this.statements[id]
diff --git a/src/support/parse.ts b/src/support/parse.ts
index b9cf433..08625f4 100644
--- a/src/support/parse.ts
+++ b/src/support/parse.ts
@@ -268,10 +268,13 @@ export class MathStatement {
public readonly id: StatementID,
/** The raw statement input by the user. */
- public readonly raw: string,
+ public raw: string,
- public x: Number = 0,
- public y: Number = 0,
+ /** The x position in the grid. */
+ public x: number = 0,
+
+ /** The y position in the grid. */
+ public y: number = 0,
) {}
/** Parse the raw statement to an AST. */
@@ -341,4 +344,12 @@ export class MathStatement {
return true
}
+
+ isDeclaration(): boolean {
+ return this.defines().length > 0
+ }
+
+ isFunctionDeclaration(): boolean {
+ return false
+ }
}