aboutsummaryrefslogtreecommitdiff
path: root/imports/codemirror/mode/rpm/changes/changes.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-02-14 11:07:21 -0800
committerValerio Virgillito2012-02-14 11:07:21 -0800
commitf060190a3bffd9a16718f2ce0499699103d46372 (patch)
treea308fe7eacec2156c8212dff0892a3de925d5f9a /imports/codemirror/mode/rpm/changes/changes.js
parentf766cc203f30ea43ae8b83cf4b65d45cc4435ee9 (diff)
parent33bc9d62b8e6694500bf14d5b18187bd99a520a3 (diff)
downloadninja-f060190a3bffd9a16718f2ce0499699103d46372.tar.gz
Merge branch 'FileIO' of https://github.com/joseeight/ninja-internal into integration
Diffstat (limited to 'imports/codemirror/mode/rpm/changes/changes.js')
-rwxr-xr-ximports/codemirror/mode/rpm/changes/changes.js19
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 @@
1CodeMirror.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
19CodeMirror.defineMIME("text/x-rpm-changes", "changes");