diff options
author | Palaparthy Adityachandra | 2020-04-02 16:03:06 +0530 |
---|---|---|
committer | GitHub | 2020-04-02 16:03:06 +0530 |
commit | d749a166c86db15f580b9e07eb65fe3344d9881a (patch) | |
tree | 68a26e2c014314086608671d97967614a5db1ff0 /yaksh/r_code_evaluator.py | |
parent | 34b72832775c48788bd5154227a3e0faf6affadd (diff) | |
parent | 61abccdcb0b0a44f4db60e3bb4d09d1ec5dc50e3 (diff) | |
download | online_test-d749a166c86db15f580b9e07eb65fe3344d9881a.tar.gz online_test-d749a166c86db15f580b9e07eb65fe3344d9881a.tar.bz2 online_test-d749a166c86db15f580b9e07eb65fe3344d9881a.zip |
Merge pull request #670 from prathamesh920/R-tests-N-codemirror-mode
Add tests for R evaluator and codemirror R mode
Diffstat (limited to 'yaksh/r_code_evaluator.py')
-rw-r--r-- | yaksh/r_code_evaluator.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/yaksh/r_code_evaluator.py b/yaksh/r_code_evaluator.py index ca4c94a..11bc970 100644 --- a/yaksh/r_code_evaluator.py +++ b/yaksh/r_code_evaluator.py @@ -49,7 +49,7 @@ class RCodeEvaluator(BaseEvaluator): # Throw message if there are commmands that terminates scilab add_err = "" if terminate_commands: - add_err = "Please do not use quit() in your\ + add_err = "Please do not use quit() q() in your\ code.\n Otherwise your code will not be evaluated\ correctly.\n" @@ -79,7 +79,8 @@ class RCodeEvaluator(BaseEvaluator): new_string = "" terminate_commands = False for line in string.splitlines(): - new_line = re.sub(r"quit.*$", "", line) + new_line = re.sub(r'quit(.*$)', "", line) + new_line = re.sub(r'q(.*$)', "", new_line) if line != new_line: terminate_commands = True new_string = new_string + '\n' + new_line |