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 {