Browse Source

Implement new for keywords into textual mode

Lucas de Souza 4 years ago
parent
commit
3f2129a899
2 changed files with 3 additions and 3 deletions
  1. 2 2
      js/util/editorMode2.js
  2. 1 1
      js/util/utils.js

+ 2 - 2
js/util/editorMode2.js

@@ -258,7 +258,7 @@ export function CodeEditorMode (CodeMirror) {
     if (typeof words === "function") {
       return words(word);
     } else {
-      return words.propertyIsEnumerable(word);
+      return Object.propertyIsEnumerable.call(words, word);
     }
   }
   const codeConfig = getCodeEditorModeConfig();
@@ -284,7 +284,7 @@ export function CodeEditorMode (CodeMirror) {
     if (typeof mimes == "string") mimes = [mimes];
     var words = [];
     function add(obj) {
-      if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))
+      if (obj) for (var prop in obj) if (Object.hasOwnProperty.call(obj, prop))
         words.push(prop);
     }
     add(mode.keywords);

+ 1 - 1
js/util/utils.js

@@ -153,7 +153,7 @@ function fillCache () {
 export function getCodeEditorModeConfig () {
   const blockList = ["RK_SWITCH", "RK_PROGRAM","RK_CASE","RK_DEFAULT","RK_FOR",
     "RK_FUNCTION","RK_DO","RK_WHILE","RK_IF","RK_ELSE"]
-  const keywordsList = ["RK_CONST","RK_RETURN","RK_BREAK"];
+  const keywordsList = ["RK_CONST","RK_RETURN","RK_BREAK","RK_FOR_FROM","RK_FOR_TO","RK_FOR_PASS"];
   const typeList = ["RK_REAL","RK_VOID","RK_BOOLEAN","RK_STRING","RK_INTEGER"];
   const atomList = ["RK_FALSE", "RK_TRUE"];