@@ -54,6 +54,7 @@ class scssc {
5454
5555 static public $ true = array ("keyword " , "true " );
5656 static public $ false = array ("keyword " , "false " );
57+ static public $ null = array ("null " );
5758
5859 static public $ defaultValue = array ("keyword " , "" );
5960 static public $ selfSelector = array ("self " );
@@ -575,12 +576,12 @@ protected function compileChild($child, $out) {
575576 break ;
576577 case "if " :
577578 list (, $ if ) = $ child ;
578- if ($ this ->reduce ($ if ->cond , true ) != self ::$ false ) {
579+ if (( $ cond = $ this ->reduce ($ if ->cond , true )) != self ::$ false && $ cond != self :: $ null ) {
579580 return $ this ->compileChildren ($ if ->children , $ out );
580581 } else {
581582 foreach ($ if ->cases as $ case ) {
582583 if ($ case ->type == "else " ||
583- $ case ->type == "elseif " && ($ this ->reduce ($ case ->cond ) != self ::$ false ))
584+ $ case ->type == "elseif " && (( $ cond = $ this ->reduce ($ case ->cond )) != self ::$ false ) && $ cond != self :: $ null )
584585 {
585586 return $ this ->compileChildren ($ case ->children , $ out );
586587 }
@@ -602,7 +603,7 @@ protected function compileChild($child, $out) {
602603 break ;
603604 case "while " :
604605 list (,$ while ) = $ child ;
605- while ($ this ->reduce ($ while ->cond , true ) != self ::$ false ) {
606+ while (( $ cond = $ this ->reduce ($ while ->cond , true )) != self ::$ false && $ cond != self :: $ null ) {
606607 $ ret = $ this ->compileChildren ($ while ->children , $ out );
607608 if ($ ret ) return $ ret ;
608609 }
0 commit comments