From e44f83fb9c13e4fab8aee07603632d533d12b4d8 Mon Sep 17 00:00:00 2001
From: syuilo <Syuilotan@yahoo.co.jp>
Date: Tue, 3 Jan 2023 15:51:49 +0900
Subject: update AiScript to 0.12.0

---
 packages/frontend/src/widgets/aiscript.vue | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'packages/frontend/src/widgets/aiscript.vue')

diff --git a/packages/frontend/src/widgets/aiscript.vue b/packages/frontend/src/widgets/aiscript.vue
index 4009edb8b8..dcc73db201 100644
--- a/packages/frontend/src/widgets/aiscript.vue
+++ b/packages/frontend/src/widgets/aiscript.vue
@@ -14,7 +14,7 @@
 
 <script lang="ts" setup>
 import { onMounted, onUnmounted, ref, watch } from 'vue';
-import { AiScript, parse, utils } from '@syuilo/aiscript';
+import { Interpreter, Parser, utils } from '@syuilo/aiscript';
 import { useWidgetPropsManager, Widget, WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget';
 import { GetFormResultType } from '@/scripts/form';
 import * as os from '@/os';
@@ -52,6 +52,8 @@ const { widgetProps, configure } = useWidgetPropsManager(name,
 	emit,
 );
 
+const parser = new Parser();
+
 const logs = ref<{
 	id: string;
 	text: string;
@@ -60,7 +62,7 @@ const logs = ref<{
 
 const run = async () => {
 	logs.value = [];
-	const aiscript = new AiScript(createAiScriptEnv({
+	const aiscript = new Interpreter(createAiScriptEnv({
 		storageKey: 'widget',
 		token: $i?.token,
 	}), {
@@ -94,7 +96,7 @@ const run = async () => {
 
 	let ast;
 	try {
-		ast = parse(widgetProps.script);
+		ast = parser.parse(widgetProps.script);
 	} catch (err) {
 		os.alert({
 			type: 'error',
-- 
cgit v1.2.3-freya

