diff options
author | Wu Cheng-Han | 2016-01-17 14:28:04 -0600 |
---|---|---|
committer | Wu Cheng-Han | 2016-01-17 14:28:04 -0600 |
commit | eaa8ccaccb1091820d0a8d1223996a6dd057347d (patch) | |
tree | 6b4aaa3b3d1a2fed68147510142663222533775a /public/vendor/codemirror/mode/rpm | |
parent | ce65e58096d57ace02723d11a125673f9d48c293 (diff) |
Upgrade CodeMirror to 5.10.1 and now support fullscreen, jump-to-line in editor
Diffstat (limited to 'public/vendor/codemirror/mode/rpm')
-rw-r--r--[-rwxr-xr-x] | public/vendor/codemirror/mode/rpm/changes/index.html | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | public/vendor/codemirror/mode/rpm/index.html | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | public/vendor/codemirror/mode/rpm/rpm.js | 26 |
3 files changed, 17 insertions, 9 deletions
diff --git a/public/vendor/codemirror/mode/rpm/changes/index.html b/public/vendor/codemirror/mode/rpm/changes/index.html index 6e5031bd..6e5031bd 100755..100644 --- a/public/vendor/codemirror/mode/rpm/changes/index.html +++ b/public/vendor/codemirror/mode/rpm/changes/index.html diff --git a/public/vendor/codemirror/mode/rpm/index.html b/public/vendor/codemirror/mode/rpm/index.html index 9a34e6df..9a34e6df 100755..100644 --- a/public/vendor/codemirror/mode/rpm/index.html +++ b/public/vendor/codemirror/mode/rpm/index.html diff --git a/public/vendor/codemirror/mode/rpm/rpm.js b/public/vendor/codemirror/mode/rpm/rpm.js index 3bb7cd2f..87cde591 100755..100644 --- a/public/vendor/codemirror/mode/rpm/rpm.js +++ b/public/vendor/codemirror/mode/rpm/rpm.js @@ -34,10 +34,10 @@ CodeMirror.defineMIME("text/x-rpm-changes", "rpm-changes"); // Quick and dirty spec file highlighting CodeMirror.defineMode("rpm-spec", function() { - var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; + var arch = /^(i386|i586|i686|x86_64|ppc64le|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; - var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/; - var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/; + var preamble = /^[a-zA-Z0-9()]+:/; + var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pretrans|posttrans|pre|post|triggerin|triggerun|verifyscript|check|triggerpostun|triggerprein|trigger)/; var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros var control_flow_simple = /^%(else|endif)/; // rpm control flow macros var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros @@ -55,8 +55,8 @@ CodeMirror.defineMode("rpm-spec", function() { if (ch == "#") { stream.skipToEnd(); return "comment"; } if (stream.sol()) { - if (stream.match(preamble)) { return "preamble"; } - if (stream.match(section)) { return "section"; } + if (stream.match(preamble)) { return "header"; } + if (stream.match(section)) { return "atom"; } } if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT' @@ -73,21 +73,29 @@ CodeMirror.defineMode("rpm-spec", function() { if (stream.eol()) { state.controlFlow = false; } } - if (stream.match(arch)) { return "number"; } + if (stream.match(arch)) { + if (stream.eol()) { state.controlFlow = false; } + return "number"; + } // Macros like '%make_install' or '%attr(0775,root,root)' if (stream.match(/^%[\w]+/)) { if (stream.match(/^\(/)) { state.macroParameters = true; } - return "macro"; + return "keyword"; } if (state.macroParameters) { if (stream.match(/^\d+/)) { return "number";} if (stream.match(/^\)/)) { state.macroParameters = false; - return "macro"; + return "keyword"; } } - if (stream.match(/^%\{\??[\w \-]+\}/)) { return "macro"; } // Macros like '%{defined fedora}' + + // Macros like '%{defined fedora}' + if (stream.match(/^%\{\??[\w \-\:\!]+\}/)) { + if (stream.eol()) { state.controlFlow = false; } + return "def"; + } //TODO: Include bash script sub-parser (CodeMirror supports that) stream.next(); |