parserlib: dot-separated layer names
This commit is contained in:
parent
1725c0ecb9
commit
fc39f0d5a6
|
@ -3503,7 +3503,7 @@ self.parserlib = (() => {
|
|||
do {
|
||||
this._ws();
|
||||
if ((t = stream.get(true)).type === Tokens.IDENT) {
|
||||
ids.push(t.value);
|
||||
ids.push(this._layerName(t));
|
||||
this._ws();
|
||||
t = stream.get(true);
|
||||
}
|
||||
|
@ -3521,6 +3521,16 @@ self.parserlib = (() => {
|
|||
this._ws();
|
||||
}
|
||||
|
||||
_layerName(start) {
|
||||
let res = '';
|
||||
const stream = this._tokenStream;
|
||||
for (let t; (t = start || stream.match(Tokens.IDENT));) {
|
||||
res += t.value + (stream.match(Tokens.DOT) ? '.' : '');
|
||||
start = false;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
_stylesheet() {
|
||||
const stream = this._tokenStream;
|
||||
this.fire('startstylesheet');
|
||||
|
@ -3590,7 +3600,7 @@ self.parserlib = (() => {
|
|||
this._ws();
|
||||
t = stream.get(true);
|
||||
if (/^layer(\()?$/i.test(t.value)) {
|
||||
layer = RegExp.$1 ? stream.mustMatch(Tokens.IDENT) : '';
|
||||
layer = RegExp.$1 ? this._layerName() : '';
|
||||
if (layer) stream.mustMatch(Tokens.RPAREN);
|
||||
this._ws();
|
||||
t = stream.get(true);
|
||||
|
|
Loading…
Reference in New Issue
Block a user