for ( String var : gctx.getVarsInScope() ) {
buf.append( var + " != empty || " );
}
buf.delete( buf.length() - 4, buf.length() );
GeneratorContext parentContext = gctx.getParent();
if ( parentContext != null ) {
Set<String> parentVarsInScope = new HashSet<String>( parentContext.getVarsInScope() );
parentVarsInScope.removeAll( gctx.getVarsInScope() );
if ( parentVarsInScope.size() > 0 ) {
buf.append( ") && !(" );
for ( String var : parentVarsInScope ) {
buf.append( var + " == empty && " );
}
buf.delete( buf.length() - 4, buf.length() );
}
}
buf.append( ") || hasNonTemplateOutput" ).append( gctx.getDepth() + "_" + gctx.getOffset() ).append( "}" );
} else {
GeneratorContext parentContext = gctx.getParent();
if ( parentContext != null ) {
Set<String> parentVarsInScope = new HashSet<String>( parentContext.getVarsInScope() );
parentVarsInScope.removeAll( gctx.getVarsInScope() );
if ( parentVarsInScope.size() > 0 ) {
buf.append( "@if{!(" );
for ( String var : parentVarsInScope ) {
buf.append( var + " == empty || " );