diff options
author | Nivesh Rajbhandari | 2012-02-20 11:14:44 -0800 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-02-20 11:14:44 -0800 |
commit | abf78e2d7a97d295ce5a1c425fd359d47379137e (patch) | |
tree | d08c91bd2aef31e6325e0b499b2ffc390018bec6 /imports/codemirror/mode/rpm/changes/changes.js | |
parent | e80a79bff57fecf3aa9b869d8ed2de5fd815287c (diff) | |
parent | e23708721a71ca4c71365f5f8e8ac7d6113926db (diff) | |
download | ninja-abf78e2d7a97d295ce5a1c425fd359d47379137e.tar.gz |
Merge branch 'refs/heads/ninja-internal' into ToolFixes
Diffstat (limited to 'imports/codemirror/mode/rpm/changes/changes.js')
-rwxr-xr-x | imports/codemirror/mode/rpm/changes/changes.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/imports/codemirror/mode/rpm/changes/changes.js b/imports/codemirror/mode/rpm/changes/changes.js new file mode 100755 index 00000000..cb45f9e5 --- /dev/null +++ b/imports/codemirror/mode/rpm/changes/changes.js | |||
@@ -0,0 +1,19 @@ | |||
1 | CodeMirror.defineMode("changes", function(config, modeConfig) { | ||
2 | var headerSeperator = /^-+$/; | ||
3 | var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /; | ||
4 | var simpleEmail = /^[\w+.-]+@[\w.-]+/; | ||
5 | |||
6 | return { | ||
7 | token: function(stream) { | ||
8 | if (stream.sol()) { | ||
9 | if (stream.match(headerSeperator)) { return 'tag'; } | ||
10 | if (stream.match(headerLine)) { return 'tag'; } | ||
11 | } | ||
12 | if (stream.match(simpleEmail)) { return 'string'; } | ||
13 | stream.next(); | ||
14 | return null; | ||
15 | } | ||
16 | }; | ||
17 | }); | ||
18 | |||
19 | CodeMirror.defineMIME("text/x-rpm-changes", "changes"); | ||