Phrozn/Vendor/Extra/scss.inc.php
protected function joinSelectors($parent, $child) {
        $setSelf = false;
        $out = array();
        foreach ($child as $part) {
            $newPart = array();
            foreach ($part as $p) {
                if ($p == self::$selfSelector) {
                    $setSelf = true;
                    foreach ($parent as $i => $parentPart) {
                        if ($i > 0) {
                            $out[] = $newPart;
                            $newPart = array();
                        }

                        foreach ($parentPart as $pp) {
                            $newPart[] = $pp;
                        }
                    }
                } else {
                    $newPart[] = $p;
                }
            }

            $out[] = $newPart;
        }

        return $setSelf ? $out : array_merge($parent, $child);
    }
protected function joinSelectors($parent, $child) {
        $setSelf = false;
        $out = array();
        foreach ($child as $part) {
            $newPart = array();
            foreach ($part as $p) {
                if ($p == self::$selfSelector) {
                    $setSelf = true;
                    foreach ($parent as $i => $parentPart) {
                        if ($i > 0) {
                            $out[] = $newPart;
                            $newPart = array();
                        }

                        foreach ($parentPart as $pp) {
                            $newPart[] = $pp;
                        }
                    }
                } else {
                    $newPart[] = $p;
                }
            }

            $out[] = $newPart;
        }

        return $setSelf ? $out : array_merge($parent, $child);
    }
protected function joinSelectors ( $ parent , $ child ) { $ setSelf = false ; $ out = array ( ) ; foreach ( $ child as $ part ) { $ newPart = array ( ) ; foreach ( $ part as $ p ) { if ( $ p == self :: $ selfSelector ) { $ setSelf = true ; foreach ( $ parent as $ i => $ parentPart ) { if ( $ i > 0 ) { $ out [ ] = $ newPart ; $ newPart = array ( ) ; } foreach ( $ parentPart as $ pp ) { $ newPart [ ] = $ pp ; } } } else { $ newPart [ ] = $ p ; } } $ out [ ] = $ newPart ; } return $ setSelf ? $ out : array_merge ( $ parent , $ child ) ; }
looks for & to replace, or append parent before child
looks for & to replace or append parent before child