9 class Less_VisitorReplacing
extends Less_Visitor
{
11 public function visitObj( $node ){
13 $funcName = 'visit'.$node->type
;
14 if( isset($this->_visitFnCache
[$funcName]) ){
17 $node = $this->$funcName( $node, $visitDeeper );
20 if( $visitDeeper && is_object($node) ){
24 $funcName = $funcName . "Out";
25 if( isset($this->_visitFnCache
[$funcName]) ){
26 $this->$funcName( $node );
37 public function visitArray( $nodes ){
40 foreach($nodes as $node){
41 $evald = $this->visitObj($node);
43 if( is_array($evald) ){
44 self
::flatten($evald,$newNodes);
53 public function flatten( $arr, &$out ){
55 foreach($arr as $item){
56 if( !is_array($item) ){
61 foreach($item as $nestedItem){
62 if( is_array($nestedItem) ){
63 self
::flatten( $nestedItem, $out);