Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-file-.../lib/codemirr.../mode/gherkin
File: gherkin.js
// CodeMirror, copyright (c) by Marijn Haverbeke and others
[0] Fix | Delete
// Distributed under an MIT license: http://codemirror.net/LICENSE
[1] Fix | Delete
[2] Fix | Delete
/*
[3] Fix | Delete
Gherkin mode - http://www.cukes.info/
[4] Fix | Delete
Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
// Following Objs from Brackets implementation: https://github.com/tregusti/brackets-gherkin/blob/master/main.js
[8] Fix | Delete
//var Quotes = {
[9] Fix | Delete
// SINGLE: 1,
[10] Fix | Delete
// DOUBLE: 2
[11] Fix | Delete
//};
[12] Fix | Delete
[13] Fix | Delete
//var regex = {
[14] Fix | Delete
// keywords: /(Feature| {2}(Scenario|In order to|As|I)| {4}(Given|When|Then|And))/
[15] Fix | Delete
//};
[16] Fix | Delete
[17] Fix | Delete
(function(mod) {
[18] Fix | Delete
if (typeof exports == "object" && typeof module == "object") // CommonJS
[19] Fix | Delete
mod(require("../../lib/codemirror"));
[20] Fix | Delete
else if (typeof define == "function" && define.amd) // AMD
[21] Fix | Delete
define(["../../lib/codemirror"], mod);
[22] Fix | Delete
else // Plain browser env
[23] Fix | Delete
mod(CodeMirror);
[24] Fix | Delete
})(function(CodeMirror) {
[25] Fix | Delete
"use strict";
[26] Fix | Delete
[27] Fix | Delete
CodeMirror.defineMode("gherkin", function () {
[28] Fix | Delete
return {
[29] Fix | Delete
startState: function () {
[30] Fix | Delete
return {
[31] Fix | Delete
lineNumber: 0,
[32] Fix | Delete
tableHeaderLine: false,
[33] Fix | Delete
allowFeature: true,
[34] Fix | Delete
allowBackground: false,
[35] Fix | Delete
allowScenario: false,
[36] Fix | Delete
allowSteps: false,
[37] Fix | Delete
allowPlaceholders: false,
[38] Fix | Delete
allowMultilineArgument: false,
[39] Fix | Delete
inMultilineString: false,
[40] Fix | Delete
inMultilineTable: false,
[41] Fix | Delete
inKeywordLine: false
[42] Fix | Delete
};
[43] Fix | Delete
},
[44] Fix | Delete
token: function (stream, state) {
[45] Fix | Delete
if (stream.sol()) {
[46] Fix | Delete
state.lineNumber++;
[47] Fix | Delete
state.inKeywordLine = false;
[48] Fix | Delete
if (state.inMultilineTable) {
[49] Fix | Delete
state.tableHeaderLine = false;
[50] Fix | Delete
if (!stream.match(/\s*\|/, false)) {
[51] Fix | Delete
state.allowMultilineArgument = false;
[52] Fix | Delete
state.inMultilineTable = false;
[53] Fix | Delete
}
[54] Fix | Delete
}
[55] Fix | Delete
}
[56] Fix | Delete
[57] Fix | Delete
stream.eatSpace();
[58] Fix | Delete
[59] Fix | Delete
if (state.allowMultilineArgument) {
[60] Fix | Delete
[61] Fix | Delete
// STRING
[62] Fix | Delete
if (state.inMultilineString) {
[63] Fix | Delete
if (stream.match('"""')) {
[64] Fix | Delete
state.inMultilineString = false;
[65] Fix | Delete
state.allowMultilineArgument = false;
[66] Fix | Delete
} else {
[67] Fix | Delete
stream.match(/.*/);
[68] Fix | Delete
}
[69] Fix | Delete
return "string";
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
// TABLE
[73] Fix | Delete
if (state.inMultilineTable) {
[74] Fix | Delete
if (stream.match(/\|\s*/)) {
[75] Fix | Delete
return "bracket";
[76] Fix | Delete
} else {
[77] Fix | Delete
stream.match(/[^\|]*/);
[78] Fix | Delete
return state.tableHeaderLine ? "header" : "string";
[79] Fix | Delete
}
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
// DETECT START
[83] Fix | Delete
if (stream.match('"""')) {
[84] Fix | Delete
// String
[85] Fix | Delete
state.inMultilineString = true;
[86] Fix | Delete
return "string";
[87] Fix | Delete
} else if (stream.match("|")) {
[88] Fix | Delete
// Table
[89] Fix | Delete
state.inMultilineTable = true;
[90] Fix | Delete
state.tableHeaderLine = true;
[91] Fix | Delete
return "bracket";
[92] Fix | Delete
}
[93] Fix | Delete
[94] Fix | Delete
}
[95] Fix | Delete
[96] Fix | Delete
// LINE COMMENT
[97] Fix | Delete
if (stream.match(/#.*/)) {
[98] Fix | Delete
return "comment";
[99] Fix | Delete
[100] Fix | Delete
// TAG
[101] Fix | Delete
} else if (!state.inKeywordLine && stream.match(/@\S+/)) {
[102] Fix | Delete
return "tag";
[103] Fix | Delete
[104] Fix | Delete
// FEATURE
[105] Fix | Delete
} else if (!state.inKeywordLine && state.allowFeature && stream.match(/(機能|功能|フィーチャ|기능|โครงหลัก|ความสามารถ|ความต้องการทางธุรกิจ|ಹೆಚ್ಚಳ|గుణము|ਮੁਹਾਂਦਰਾ|ਨਕਸ਼ ਨੁਹਾਰ|ਖਾਸੀਅਤ|रूप लेख|وِیژگی|خاصية|תכונה|Функціонал|Функция|Функционалност|Функционал|Үзенчәлеклелек|Свойство|Особина|Мөмкинлек|Могућност|Λειτουργία|Δυνατότητα|Właściwość|Vlastnosť|Trajto|Tính năng|Savybė|Pretty much|Požiadavka|Požadavek|Potrzeba biznesowa|Özellik|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Hwæt|Hwaet|Funzionalità|Funktionalitéit|Funktionalität|Funkcja|Funkcionalnost|Funkcionalitāte|Funkcia|Fungsi|Functionaliteit|Funcționalitate|Funcţionalitate|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Fīča|Feature|Eiginleiki|Egenskap|Egenskab|Característica|Caracteristica|Business Need|Aspekt|Arwedd|Ahoy matey!|Ability):/)) {
[106] Fix | Delete
state.allowScenario = true;
[107] Fix | Delete
state.allowBackground = true;
[108] Fix | Delete
state.allowPlaceholders = false;
[109] Fix | Delete
state.allowSteps = false;
[110] Fix | Delete
state.allowMultilineArgument = false;
[111] Fix | Delete
state.inKeywordLine = true;
[112] Fix | Delete
return "keyword";
[113] Fix | Delete
[114] Fix | Delete
// BACKGROUND
[115] Fix | Delete
} else if (!state.inKeywordLine && state.allowBackground && stream.match(/(背景|배경|แนวคิด|ಹಿನ್ನೆಲೆ|నేపథ్యం|ਪਿਛੋਕੜ|पृष्ठभूमि|زمینه|الخلفية|רקע|Тарих|Предыстория|Предистория|Позадина|Передумова|Основа|Контекст|Кереш|Υπόβαθρο|Założenia|Yo\-ho\-ho|Tausta|Taust|Situācija|Rerefons|Pozadina|Pozadie|Pozadí|Osnova|Latar Belakang|Kontext|Konteksts|Kontekstas|Kontekst|Háttér|Hannergrond|Grundlage|Geçmiş|Fundo|Fono|First off|Dis is what went down|Dasar|Contexto|Contexte|Context|Contesto|Cenário de Fundo|Cenario de Fundo|Cefndir|Bối cảnh|Bakgrunnur|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|Ær|Aer|Achtergrond):/)) {
[116] Fix | Delete
state.allowPlaceholders = false;
[117] Fix | Delete
state.allowSteps = true;
[118] Fix | Delete
state.allowBackground = false;
[119] Fix | Delete
state.allowMultilineArgument = false;
[120] Fix | Delete
state.inKeywordLine = true;
[121] Fix | Delete
return "keyword";
[122] Fix | Delete
[123] Fix | Delete
// SCENARIO OUTLINE
[124] Fix | Delete
} else if (!state.inKeywordLine && state.allowScenario && stream.match(/(場景大綱|场景大纲|劇本大綱|剧本大纲|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|시나리오 개요|สรุปเหตุการณ์|โครงสร้างของเหตุการณ์|ವಿವರಣೆ|కథనం|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਟਕਥਾ ਢਾਂਚਾ|परिदृश्य रूपरेखा|سيناريو مخطط|الگوی سناریو|תבנית תרחיש|Сценарийның төзелеше|Сценарий структураси|Структура сценарію|Структура сценария|Структура сценарија|Скица|Рамка на сценарий|Концепт|Περιγραφή Σεναρίου|Wharrimean is|Template Situai|Template Senario|Template Keadaan|Tapausaihio|Szenariogrundriss|Szablon scenariusza|Swa hwær swa|Swa hwaer swa|Struktura scenarija|Structură scenariu|Structura scenariu|Skica|Skenario konsep|Shiver me timbers|Senaryo taslağı|Schema dello scenario|Scenariomall|Scenariomal|Scenario Template|Scenario Outline|Scenario Amlinellol|Scenārijs pēc parauga|Scenarijaus šablonas|Reckon it's like|Raamstsenaarium|Plang vum Szenario|Plan du Scénario|Plan du scénario|Osnova scénáře|Osnova Scenára|Náčrt Scenáru|Náčrt Scénáře|Náčrt Scenára|MISHUN SRSLY|Menggariskan Senario|Lýsing Dæma|Lýsing Atburðarásar|Konturo de la scenaro|Koncept|Khung tình huống|Khung kịch bản|Forgatókönyv vázlat|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esbozo do escenario|Delineação do Cenário|Delineacao do Cenario|All y'all|Abstrakt Scenario|Abstract Scenario):/)) {
[125] Fix | Delete
state.allowPlaceholders = true;
[126] Fix | Delete
state.allowSteps = true;
[127] Fix | Delete
state.allowMultilineArgument = false;
[128] Fix | Delete
state.inKeywordLine = true;
[129] Fix | Delete
return "keyword";
[130] Fix | Delete
[131] Fix | Delete
// EXAMPLES
[132] Fix | Delete
} else if (state.allowScenario && stream.match(/(例子|例|サンプル|예|ชุดของเหตุการณ์|ชุดของตัวอย่าง|ಉದಾಹರಣೆಗಳು|ఉదాహరణలు|ਉਦਾਹਰਨਾਂ|उदाहरण|نمونه ها|امثلة|דוגמאות|Үрнәкләр|Сценарији|Примеры|Примери|Приклади|Мисоллар|Мисаллар|Σενάρια|Παραδείγματα|You'll wanna|Voorbeelden|Variantai|Tapaukset|Se þe|Se the|Se ðe|Scenarios|Scenariji|Scenarijai|Przykłady|Primjeri|Primeri|Příklady|Príklady|Piemēri|Példák|Pavyzdžiai|Paraugs|Örnekler|Juhtumid|Exemplos|Exemples|Exemple|Exempel|EXAMPLZ|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|Dữ liệu|Dead men tell no tales|Dæmi|Contoh|Cenários|Cenarios|Beispiller|Beispiele|Atburðarásir):/)) {
[133] Fix | Delete
state.allowPlaceholders = false;
[134] Fix | Delete
state.allowSteps = true;
[135] Fix | Delete
state.allowBackground = false;
[136] Fix | Delete
state.allowMultilineArgument = true;
[137] Fix | Delete
return "keyword";
[138] Fix | Delete
[139] Fix | Delete
// SCENARIO
[140] Fix | Delete
} else if (!state.inKeywordLine && state.allowScenario && stream.match(/(場景|场景|劇本|剧本|シナリオ|시나리오|เหตุการณ์|ಕಥಾಸಾರಾಂಶ|సన్నివేశం|ਪਟਕਥਾ|परिदृश्य|سيناريو|سناریو|תרחיש|Сценарій|Сценарио|Сценарий|Пример|Σενάριο|Tình huống|The thing of it is|Tapaus|Szenario|Swa|Stsenaarium|Skenario|Situai|Senaryo|Senario|Scenaro|Scenariusz|Scenariu|Scénario|Scenario|Scenarijus|Scenārijs|Scenarij|Scenarie|Scénář|Scenár|Primer|MISHUN|Kịch bản|Keadaan|Heave to|Forgatókönyv|Escenario|Escenari|Cenário|Cenario|Awww, look mate|Atburðarás):/)) {
[141] Fix | Delete
state.allowPlaceholders = false;
[142] Fix | Delete
state.allowSteps = true;
[143] Fix | Delete
state.allowBackground = false;
[144] Fix | Delete
state.allowMultilineArgument = false;
[145] Fix | Delete
state.inKeywordLine = true;
[146] Fix | Delete
return "keyword";
[147] Fix | Delete
[148] Fix | Delete
// STEPS
[149] Fix | Delete
} else if (!state.inKeywordLine && state.allowSteps && stream.match(/(那麼|那么|而且|當|当|并且|同時|同时|前提|假设|假設|假定|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|하지만|조건|먼저|만일|만약|단|그리고|그러면|และ |เมื่อ |แต่ |ดังนั้น |กำหนดให้ |ಸ್ಥಿತಿಯನ್ನು |ಮತ್ತು |ನೀಡಿದ |ನಂತರ |ಆದರೆ |మరియు |చెప్పబడినది |కాని |ఈ పరిస్థితిలో |అప్పుడు |ਪਰ |ਤਦ |ਜੇਕਰ |ਜਿਵੇਂ ਕਿ |ਜਦੋਂ |ਅਤੇ |यदि |परन्तु |पर |तब |तदा |तथा |जब |चूंकि |किन्तु |कदा |और |अगर |و |هنگامی |متى |لكن |عندما |ثم |بفرض |با فرض |اما |اذاً |آنگاه |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Һәм |Унда |Тоді |Тогда |То |Также |Та |Пусть |Припустимо, що |Припустимо |Онда |Но |Нехай |Нәтиҗәдә |Лекин |Ләкин |Коли |Когда |Когато |Када |Кад |К тому же |І |И |Задато |Задати |Задате |Если |Допустим |Дано |Дадено |Вә |Ва |Бирок |Әмма |Әйтик |Әгәр |Аммо |Али |Але |Агар |А також |А |Τότε |Όταν |Και |Δεδομένου |Αλλά |Þurh |Þegar |Þa þe |Þá |Þa |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Za předpokladu |Za predpokladu |Youse know when youse got |Youse know like when |Yna |Yeah nah |Y'know |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |wann |Ve |Và |Und |Un |ugeholl |Too right |Thurh |Thì |Then y'all |Then |Tha the |Tha |Tetapi |Tapi |Tak |Tada |Tad |Stel |Soit |Siis |Și |Şi |Si |Sed |Se |Så |Quando |Quand |Quan |Pryd |Potom |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Niin |Nhưng |När |Når |Mutta |Men |Mas |Maka |Majd |Mając |Mais |Maar |mä |Ma |Lorsque |Lorsqu'|Logo |Let go and haul |Kun |Kuid |Kui |Kiedy |Khi |Ketika |Kemudian |Keď |Když |Kaj |Kai |Kada |Kad |Jeżeli |Jeśli |Ja |It's just unbelievable |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben seien |Gegeben sei |Gdy |Gangway! |Fakat |Étant donnés |Etant donnés |Étant données |Etant données |Étant donnée |Etant donnée |Étant donné |Etant donné |Et |És |Entonces |Entón |Então |Entao |En |Eğer ki |Ef |Eeldades |E |Ðurh |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Diberi |Dengan |Den youse gotta |DEN |De |Dato |Dați fiind |Daţi fiind |Dati fiind |Dati |Date fiind |Date |Data |Dat fiind |Dar |Dann |dann |Dan |Dados |Dado |Dadas |Dada |Ða ðe |Ða |Cuando |Cho |Cando |Când |Cand |Cal |But y'all |But at the end of the day I reckon |BUT |But |Buh |Blimey! |Biết |Bet |Bagi |Aye |awer |Avast! |Atunci |Atesa |Atès |Apabila |Anrhegedig a |Angenommen |And y'all |And |AN |An |an |Amikor |Amennyiben |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Ak |Adott |Ac |Aber |A zároveň |A tiež |A taktiež |A také |A |a |7 |\* )/)) {
[150] Fix | Delete
state.inStep = true;
[151] Fix | Delete
state.allowPlaceholders = true;
[152] Fix | Delete
state.allowMultilineArgument = true;
[153] Fix | Delete
state.inKeywordLine = true;
[154] Fix | Delete
return "keyword";
[155] Fix | Delete
[156] Fix | Delete
// INLINE STRING
[157] Fix | Delete
} else if (stream.match(/"[^"]*"?/)) {
[158] Fix | Delete
return "string";
[159] Fix | Delete
[160] Fix | Delete
// PLACEHOLDER
[161] Fix | Delete
} else if (state.allowPlaceholders && stream.match(/<[^>]*>?/)) {
[162] Fix | Delete
return "variable";
[163] Fix | Delete
[164] Fix | Delete
// Fall through
[165] Fix | Delete
} else {
[166] Fix | Delete
stream.next();
[167] Fix | Delete
stream.eatWhile(/[^@"<#]/);
[168] Fix | Delete
return null;
[169] Fix | Delete
}
[170] Fix | Delete
}
[171] Fix | Delete
};
[172] Fix | Delete
});
[173] Fix | Delete
[174] Fix | Delete
CodeMirror.defineMIME("text/x-feature", "gherkin");
[175] Fix | Delete
[176] Fix | Delete
});
[177] Fix | Delete
[178] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function