From deee5c01586a7630fb0c1b32d4635fd4bb5fa545 Mon Sep 17 00:00:00 2001 From: "noor.masarwa" <62531656+Noormasarwa@users.noreply.github.com> Date: Tue, 22 Oct 2024 14:21:57 +0300 Subject: [PATCH] [gherkin mode]: Add support for Rule Example keywords Co-authored-by: Noor-Masarwe --- mode/gherkin/gherkin.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mode/gherkin/gherkin.js b/mode/gherkin/gherkin.js index 196543e505..b6464310c9 100644 --- a/mode/gherkin/gherkin.js +++ b/mode/gherkin/gherkin.js @@ -155,6 +155,22 @@ CodeMirror.defineMode("gherkin", function () { state.inKeywordLine = true; return "keyword"; + // RULE + } else if (state.allowScenario && stream.match(/(規則|ルール|قانون|قواعد|חוק|قاعدة|Правило|Правила|Reegel|Regel|Règle|Regola|Regla|Regulă|Regul|Regula|Regel|Regel|Regula|Правило|Правила|Regel|Regola|Regul|Reeglid|Rule):/)) { + state.allowPlaceholders = false; + state.allowSteps = true; + state.allowBackground = false; + state.allowMultilineArgument = true; + return "keyword"; + + // EXAMPLE + } else if (state.allowScenario && stream.match(/(例子|例|サンプル|예|דוגמה|مثال|Үрнәк|Пример|Παράδειγμα|Exemplo|Exemple|Beispiel|Ejemplo|Example|Esempio|Örnek|Példa|Pavyzdys|Paraugs|Voorbeeld|Příklad|Príklad|Exemplu|Esempi):/)) { + state.allowPlaceholders = false; + state.allowSteps = true; + state.allowBackground = false; + state.allowMultilineArgument = true; + return "keyword"; + // INLINE STRING } else if (stream.match(/"[^"]*"?/)) { return "string";