From a95b61ae7adb587085aa8ee5d75ecfc36ce433e2 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Fri, 4 Oct 2024 17:25:29 +0800 Subject: [PATCH] update --- src/composables/helper.ts | 49 +++++++++++++++++++++++++++------------ src/mobile/Helper.vue | 6 ++--- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/src/composables/helper.ts b/src/composables/helper.ts index de1d608..8aa9f30 100644 --- a/src/composables/helper.ts +++ b/src/composables/helper.ts @@ -2,15 +2,15 @@ import { ref } from "vue" export const insertText = ref("") -export const cTexts = [ +export const cSymbols = [ ";", ",", "&", "{}", - " = ", - " == ", - " > ", - " < ", + "=", + "==", + ">", + "<", " != ", " || ", " && ", @@ -22,27 +22,46 @@ export const cTexts = [ "%d", "%.2f", "if () {}", - " else ", + "else {}", + "a", + "b", + "c", + "\n", ] -export const pythonTexts = [ +export const pythonSymbols = [ ":", '""', - " = ", - " == ", - " > ", - " < ", + ",", + "+", + "-", + "*", + "/", + "//", + "%", + "()", + "=", + "==", + ">", + "<", " != ", "print()", "input()", - "if :", + "if ", "else:", - "elif :", "for ", " in ", "range():", - "while", + "while ", "[]", - "{}", '"%.2f" % ', + "a", + "b", + "c", + "\n", ] + +export function getText(c: string) { + if (c === "\n") return "回车" + else return c +} diff --git a/src/mobile/Helper.vue b/src/mobile/Helper.vue index fb59ce2..18b7691 100644 --- a/src/mobile/Helper.vue +++ b/src/mobile/Helper.vue @@ -1,14 +1,14 @@