SUMMARY Current logic don't handle this situation very well, because for a expression only from comments index of prompt doesn't increase and we don't expect it. Regexp will not handle this very well, so I think, we need use Octave include files, create Octave AST from command and check, that the AST not from comment only (using embedded octave could be useful for Octave backend at all, not only in this situation). STEPS TO REPRODUCE 1. Open Octave worksheet 2. Add command entry with only comments, like "#Comment" 3. Run the entry OBSERVED RESULT The entry never finished. But we could interrupt the expression or restart Backend. EXPECTED RESULT The entry finished without output.
Git commit 87afb9441dde48165312d5bad6405cab259c407f by Nikita Sirgienko. Committed on 14/03/2019 at 21:42. Pushed by sirgienko into branch 'master'. [Octave] Some fixes - Fix problem with comment in multiline octave command - Fix bug with empty command, which never finish execution FIXED-IN: 19.04 M +27 -0 src/backends/octave/octaveexpression.cpp M +1 -1 src/backends/octave/octavesession.cpp M +23 -3 src/backends/octave/testoctave.cpp M +1 -0 src/backends/octave/testoctave.h https://commits.kde.org/cantor/87afb9441dde48165312d5bad6405cab259c407f
Simple state machine (three states: code, string, comment), which remove all comments from user command enough for solving this problem.