Added guards checking to namespaces. Issue #1418.

This commit is contained in:
jurcovicovam
2014-09-05 09:01:56 +02:00
parent 9c7854708b
commit c330c3a4a8
4 changed files with 115 additions and 30 deletions

View File

@@ -91,3 +91,11 @@
.mixin-generated-class {
a: 1;
}
#guarded-caller {
guarded: namespace;
silent: namespace;
guarded: with default;
}
#guarded-deeper {
should: match 1;
}

View File

@@ -171,3 +171,58 @@
}
#ns > .mixin-for-root-usage(1);
@namespaceGuard: 1;
#guarded when (@namespaceGuard>0) {
#deeper {
.mixin() {
guarded: namespace;
}
}
}
#guarded() when (@namespaceGuard>0) {
#deeper {
.mixin() {
silent: namespace;
}
}
}
#guarded(@variable) when (@namespaceGuard>0) {
#deeper {
.mixin() {
should: not match because namespace argument;
}
}
}
#guarded(@variable: default) when (@namespaceGuard>0) {
#deeper {
.mixin() {
guarded: with default;
}
}
}
#guarded when (@namespaceGuard<0) {
#deeper {
.mixin() {
should: not match because namespace guard;
}
}
}
#guarded-caller {
#guarded > #deeper > .mixin();
}
#top {
#deeper when (@namespaceGuard<0) {
.mixin(@a) {
should: not match because namespace guard;
}
}
#deeper() when (@namespaceGuard>0) {
.mixin(@a) {
should: match @a;
}
}
}
#guarded-deeper {
#top > #deeper > .mixin(1);
}