mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-10 23:35:45 +01:00
Hopefully remove some :abbrev silliiodocy.
This commit is contained in:
@@ -164,14 +164,14 @@ const Highlights = Module("Highlight", {
|
||||
this.set(k, null, true);
|
||||
},
|
||||
|
||||
groupRegexp: RegExp(String.replace(<![CDATA[
|
||||
groupRegexp: util.regexp(<![CDATA[
|
||||
^
|
||||
(\s* (?:\S|\s\S)+ \s+)
|
||||
\{ ([^}]*) \}
|
||||
\s*
|
||||
$
|
||||
]]>, /\s*/g, ""), "gm"),
|
||||
sheetRegexp: RegExp(String.replace(<![CDATA[
|
||||
]]>, "gm"),
|
||||
sheetRegexp: util.regexp(<![CDATA[
|
||||
^\s*
|
||||
!? \*?
|
||||
( (?:[^;\s]|\s\S)+ )
|
||||
@@ -179,7 +179,7 @@ const Highlights = Module("Highlight", {
|
||||
(?:; ( (?:[^ \s]|\s\S)+ ) )?
|
||||
\s* (.*)
|
||||
$
|
||||
]]>, /\s*/g, "")),
|
||||
]]>),
|
||||
|
||||
/**
|
||||
* Bulk loads new CSS rules, in the format of,
|
||||
|
||||
@@ -258,9 +258,7 @@ const Styles = Module("Styles", {
|
||||
});
|
||||
},
|
||||
|
||||
propertyPattern: (function () {
|
||||
const string = /(?:"(?:[^\\"]|\\.)*(?:"|$)|'(?:[^\\']|\\.)*(?:'|$))/.source;
|
||||
return RegExp(String.replace(<![CDATA[
|
||||
propertyPattern: util.regexp(<![CDATA[
|
||||
(?:
|
||||
(\s*)
|
||||
([-a-z]*)
|
||||
@@ -270,19 +268,18 @@ const Styles = Module("Styles", {
|
||||
[-\w]
|
||||
(?:
|
||||
\s* \( \s*
|
||||
(?: S | [^)]* )
|
||||
(?: <string> | [^)]* )
|
||||
\s* (?: \) | $)
|
||||
)?
|
||||
\s*
|
||||
| \s* S \s* | [^;}]*
|
||||
| \s* <string> \s* | [^;}]*
|
||||
)*
|
||||
)
|
||||
)?
|
||||
)
|
||||
(\s* (?: ; | $) )
|
||||
]]>, /S/g, string).replace(/\s*/g, ""),
|
||||
"gi");
|
||||
})()
|
||||
]]>, "gi",
|
||||
{ string: /(?:"(?:[^\\"]|\\.)*(?:"|$)|'(?:[^\\']|\\.)*(?:'|$))/ })
|
||||
}, {
|
||||
commands: function (dactyl, modules, window) {
|
||||
const commands = modules.commands;
|
||||
|
||||
@@ -846,6 +846,30 @@ const Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates a new RegExp object based on the value of expr stripped
|
||||
* of all white space and interpolated with the values from tokens.
|
||||
* If tokens, any string in the form of <key> in expr is replaced
|
||||
* with the value of the property, 'key', from tokens, if that
|
||||
* property exists. If the property value is itself a RegExp, its
|
||||
* source is substituted rather than its string value.
|
||||
*
|
||||
* Additionally, expr is stripped of all JavaScript comments.
|
||||
*
|
||||
* This is similar to Perl's extended regular expression format.
|
||||
*
|
||||
* @param {string|XML} expr The expression to compile into a RegExp.
|
||||
* @param {string} flags Flags to apply to the new RegExp.
|
||||
* @param {object} tokens The tokens to substitute. @optional
|
||||
*/
|
||||
regexp: function (expr, flags, tokens) {
|
||||
if (tokens)
|
||||
expr = String.replace(expr, /<(\w+)>/g, function (m, n1) set.has(tokens, n1) ? tokens[n1].source || tokens[n1] : m);
|
||||
expr = String.replace(expr, /\/\/[^\n]*|\/\*[^]*?\*\//gm, "")
|
||||
.replace(/\s+/g, "");
|
||||
return RegExp(expr, flags);
|
||||
},
|
||||
|
||||
maxErrors: 15,
|
||||
errors: Class.memoize(function () []),
|
||||
reportError: function (error) {
|
||||
|
||||
Reference in New Issue
Block a user