Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #202 from jhedstrom/sh_gherkin

Add syntax highlighting for Gherkin
  • Loading branch information...
commit 7b7d9c0fe629d44366d7003ca2fd619fbce5eec7 2 parents e68a92b + 3ebb905
@matthewmccullough matthewmccullough authored
View
112 public/js/sh_lang/sh_gherkin.js
@@ -0,0 +1,112 @@
+if (! this.sh_languages) {
+ this.sh_languages = {};
+}
+sh_languages['gherkin'] = [
+ [
+ [
+ /#/g,
+ 'sh_comment',
+ 1
+ ],
+ [
+ /\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,
+ 'sh_number',
+ -1
+ ],
+ [
+ /^(?:[\s]*(?:But |And |Then |When |Given |\* |Scenarios|Examples|Scenario Template|Scenario Outline|Scenario|Background|Feature))/g,
+ 'sh_keyword',
+ -1
+ ],
+ [
+ /^(?:[\s]*'(?:[^\\']|\\.)*'[\s]*|[\s]*\"(?:[^\\\"]|\\.)*\"[\s]*)$/g,
+ 'sh_comment',
+ -1
+ ],
+ [
+ /(?:[\s]*'{3})/g,
+ 'sh_string',
+ 2
+ ],
+ [
+ /(?:[\s]*\"{3})/g,
+ 'sh_string',
+ 3
+ ],
+ [
+ /"/g,
+ 'sh_string',
+ 4
+ ],
+ [
+ /'/g,
+ 'sh_string',
+ 5
+ ],
+ [
+ /(?:@[^@\r\n\t ]+)/g,
+ 'sh_type',
+ -1
+ ],
+ [
+ /\|/g,
+ 'sh_specialchar',
+ -1
+ ]
+ ],
+ [
+ [
+ /$/g,
+ null,
+ -2
+ ]
+ ],
+ [
+ [
+ /(?:'{3})/g,
+ 'sh_string',
+ -2
+ ]
+ ],
+ [
+ [
+ /(?:\"{3})/g,
+ 'sh_string',
+ -2
+ ]
+ ],
+ [
+ [
+ /$/g,
+ null,
+ -2
+ ],
+ [
+ /\\(?:\\|")/g,
+ null,
+ -1
+ ],
+ [
+ /"/g,
+ 'sh_string',
+ -2
+ ]
+ ],
+ [
+ [
+ /$/g,
+ null,
+ -2
+ ],
+ [
+ /\\(?:\\|')/g,
+ null,
+ -1
+ ],
+ [
+ /'/g,
+ 'sh_string',
+ -2
+ ]
+ ]
+];
View
1  public/js/sh_lang/sh_gherkin.min.js
@@ -0,0 +1 @@
+if(!this.sh_languages){this.sh_languages={}}sh_languages.gherkin=[[[/#/g,"sh_comment",1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/^(?:[\s]*(?:But |And |Then |When |Given |\* |Scenarios|Examples|Scenario Template|Scenario Outline|Scenario|Background|Feature))/g,"sh_keyword",-1],[/^(?:[\s]*'(?:[^\\']|\\.)*'[\s]*|[\s]*\"(?:[^\\\"]|\\.)*\"[\s]*)$/g,"sh_comment",-1],[/(?:[\s]*'{3})/g,"sh_string",2],[/(?:[\s]*\"{3})/g,"sh_string",3],[/"/g,"sh_string",4],[/'/g,"sh_string",5],[/(?:@[^@\r\n\t ]+)/g,"sh_type",-1],[/\|/g,"sh_specialchar",-1]],[[/$/g,null,-2]],[[/(?:'{3})/g,"sh_string",-2]],[[/(?:\"{3})/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|')/g,null,-1],[/'/g,"sh_string",-2]]];
Please sign in to comment.
Something went wrong with that request. Please try again.