From 9533280f7efba5438d3aed20219cc190001254cd Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Sat, 6 May 2023 10:46:13 +0800 Subject: [PATCH] fix --- src/components/codemirror.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/codemirror.vue b/src/components/codemirror.vue index 045062d..1d1e392 100644 --- a/src/components/codemirror.vue +++ b/src/components/codemirror.vue @@ -174,7 +174,7 @@ export default { showCursorWhenSelecting: true, theme: "monokai" // 主题 }, - inputTextReg: /^((?!#).*?(,|\(|\[|\{|\s)+)?input(?!\w)\(['|"]([\s\S]+?)['|"]\)/m, // 匹配input() + inputTextReg: /^((?!#).*?(,|\s?|\(|\[|\{)+)?input(?!\w)\(['|"]([\s\S]+?)['|"]\)/m, // 匹配input() requestList: [], // 有input的情况下,保存每个axios的对象,用于中断请求 sourceCode: '', // 把input替换成exit函数后的代码 requestTimer: null, // 用于中断请求的定时器 @@ -362,7 +362,7 @@ export default { type: "warning" }) } else { - const inputTextReg = this.inputTextReg + const { inputTextReg } = this const inputFuncReg = /input\(['|"]/g const bcId = this.judgmentId const cid = this.courseId @@ -389,7 +389,6 @@ export default { }).then(res => { const data = res.code const result = data.runResult - debugger if(result.includes('File ')){ if (isWhile) { this.runResult += result @@ -504,7 +503,7 @@ export default {