1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-16 14:05:45 +01:00

util.regexp.iterate

--HG--
extra : rebase_source : 2c9d5a20ceb0a3ffde32ad8989ce6f594df8c406
This commit is contained in:
Kris Maglione
2011-01-20 05:39:27 -05:00
parent 89d57a9106
commit 8ab964fedb
3 changed files with 32 additions and 23 deletions

View File

@@ -330,11 +330,9 @@ var Styles = Module("Styles", {
},
propertyIter: function (str, always) {
this.propertyPattern.lastIndex = 0;
let match, i = 0;
while ((!match || match[0]) && (match = Styles.propertyPattern.exec(str)))
if (always && !i++ || match[0] && match[3])
let i = 0;
for (let match in this.propertyPattern.iterate(str))
if (always && !i++ || match[0] && match.value)
yield match;
},
@@ -367,15 +365,6 @@ var Styles = Module("Styles", {
}),
patterns: memoize({
iter: function (pattern, str) {
pattern = this[pattern];
pattern.lastIndex = 0;
let match;
while ((match = pattern.exec(str)) && match[0].length)
yield match;
},
get property() util.regexp(<![CDATA[
(?:
(?P<preSpace> <space>*)