Skip to content

Commit

Permalink
remove syntax feature
Browse files Browse the repository at this point in the history
takes too long (~200ms), causes very slight delay in response
  • Loading branch information
Almenon committed Nov 13, 2024
1 parent cbffd19 commit 3a60b05
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions src/toAREPLLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,33 +76,8 @@ export class ToAREPLLogic{
this.lastCodeSection = data.evalCode
this.lastSavedSection = data.savedCode
this.lastEndSection = endSection
let syntaxPromise: Promise<{}>

// only execute code if syntax is correct
// this is because it's annoying to have GUI apps restart constantly while typing
syntaxPromise = this.PythonExecutor.checkSyntax(data.savedCode + data.evalCode)
syntaxPromise.then(() => {
this.PythonExecutor.execCode(data)
})
.catch((error: NodeJS.ErrnoException|string) => {

// an ErrnoException is a bad internal error
let internalErr = ""
if(typeof(error) != "string"){
internalErr = error.message + '\n\n' + error.stack
error = ""
}

// todo: refactor above to call arepl to check syntax so we get a actual error object back instead of error text
// The error text has a bunch of useless info

this.previewContainer.handleResult(
{
userVariables:{}, userError:null, userErrorMsg:<string>error, execTime: 0, totalPyTime: 0, totalTime: 0,
internalError: internalErr, caller: "", lineno: -1, done: true, evaluatorName: "", startResult: false,
}
)
})
this.PythonExecutor.execCode(data)

return true
}
Expand Down

0 comments on commit 3a60b05

Please sign in to comment.