update AiScript to 0.12.0

This commit is contained in:
syuilo
2023-01-03 15:51:49 +09:00
parent db1ca28de3
commit e44f83fb9c
15 changed files with 75 additions and 157 deletions

View File

@@ -27,7 +27,7 @@ import 'prismjs/components/prism-javascript';
import 'prismjs/themes/prism-okaidia.css';
import { PrismEditor } from 'vue-prism-editor';
import 'vue-prism-editor/dist/prismeditor.min.css';
import { AiScript, parse, utils } from '@syuilo/aiscript';
import { Interpreter, Parser, utils } from '@syuilo/aiscript';
import MkContainer from '@/components/MkContainer.vue';
import MkButton from '@/components/MkButton.vue';
import { createAiScriptEnv } from '@/scripts/aiscript/api';
@@ -36,6 +36,8 @@ import { $i } from '@/account';
import { i18n } from '@/i18n';
import { definePageMetadata } from '@/scripts/page-metadata';
const parser = new Parser();
const code = ref('');
const logs = ref<any[]>([]);
@@ -50,7 +52,7 @@ watch(code, () => {
async function run() {
logs.value = [];
const aiscript = new AiScript(createAiScriptEnv({
const aiscript = new Interpreter(createAiScriptEnv({
storageKey: 'scratchpad',
token: $i?.token,
}), {
@@ -84,7 +86,7 @@ async function run() {
let ast;
try {
ast = parse(code.value);
ast = parser.parse(code.value);
} catch (error) {
os.alert({
type: 'error',