Fallback to blocks from deferred calls

This commit is contained in:
robotis
2012-05-07 09:49:31 +00:00
parent 2fb2de84fa
commit 61c09ca2e0
4 changed files with 48 additions and 7 deletions

View File

@@ -54,17 +54,25 @@ class Deferred(Node):
break
scope.deferred.parsed[-1].pop()
scope.deferred.parsed[-1] = store
if not mixins:
# Fallback to blocks
block = scope.blocks(ident.raw())
if block:
res = block.copy_inner(scope)
if mixins:
for mixin in mixins:
res = mixin.call(scope, args)
if res: break
if res:
[scope.add_variable(v) for v in mixin.vars]
scope.deferred = ident
if res:
[scope.add_variable(v) for v in mixin.vars]
scope.deferred = ident
break
if res:
res = [p.parse(scope) for p in res if p]
while(any(t for t in res if type(t) is Deferred)):
res = [p.parse(scope) for p in res if p]
while(any(t for t in res if type(t) is Deferred)):
res = [p.parse(scope) for p in res if p]
if error and not res:
raise SyntaxError('NameError `%s`' % mixin.raw(True))

View File

@@ -86,3 +86,18 @@ div.nest a:hover .deep p, div.nest a:focus .deep p {
padding: 3px;
padding: 3px;
}
.clear {
padding: -100px;
}
.clear:before {
display: table;
content: "";
}
.fallback {
margin: 2px;
padding: -100px;
}
.fallback:before {
display: table;
content: "";
}

View File

@@ -25,3 +25,7 @@ div.nest a:hover .deep p,div.nest a:focus .deep p{widows:3;}
.secure-zone{color:transparent;}
.outer .inner{padding:3px;}
.tx{padding:3px;padding:3px;}
.clear{padding:-100px;}
.clear:before{display:table;content:"";}
.fallback{margin:2px;padding:-100px;}
.fallback:before{display:table;content:"";}

View File

@@ -105,4 +105,18 @@ div.nest {
.outer .inner;
// Same
.outer > .inner;
}
}
//
// Fallbacks
//
.clear {
padding: -100px;
&:before {
display: table;
content: "";
}
}
.fallback {
margin: 2px;
.clear();
}