Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump leafo/scssphp from 0.7.6 to 0.7.7 #137

Merged
merged 2 commits into from
Sep 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"icewind/Streams": "0.6.1",
"interfasys/lognormalizer": "^v1.0",
"jeremeamia/superclosure": "2.1.0",
"leafo/scssphp": "0.7.6",
"leafo/scssphp": "0.7.7",
"league/flysystem": "^1.0",
"lukasreschke/id3parser": "^0.0.1",
"nikic/php-parser": "1.4.1",
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -1342,17 +1342,17 @@
},
{
"name": "leafo/scssphp",
"version": "v0.7.6",
"version_normalized": "0.7.6.0",
"version": "v0.7.7",
"version_normalized": "0.7.7.0",
"source": {
"type": "git",
"url": "https://github.com/leafo/scssphp.git",
"reference": "585f6ae84de62ffecf69c23805f25d78d7e4b794"
"reference": "1d656f8c02a3a69404bba6b28ec4e06edddf0f49"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/leafo/scssphp/zipball/585f6ae84de62ffecf69c23805f25d78d7e4b794",
"reference": "585f6ae84de62ffecf69c23805f25d78d7e4b794",
"url": "https://api.github.com/repos/leafo/scssphp/zipball/1d656f8c02a3a69404bba6b28ec4e06edddf0f49",
"reference": "1d656f8c02a3a69404bba6b28ec4e06edddf0f49",
"shasum": ""
},
"require": {
Expand All @@ -1362,7 +1362,7 @@
"phpunit/phpunit": "~4.6",
"squizlabs/php_codesniffer": "~2.5"
},
"time": "2018-05-24T02:18:53+00:00",
"time": "2018-07-22T01:22:08+00:00",
"bin": [
"bin/pscss"
],
Expand Down
56 changes: 44 additions & 12 deletions leafo/scssphp/src/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3655,7 +3655,7 @@ protected function callNativeFunction($name, $args, &$returnValue)
return false;
}

list($sorted, $kwargs) = $this->sortArgs($prototype, $args);
@list($sorted, $kwargs) = $this->sortArgs($prototype, $args);

if ($name !== 'if' && $name !== 'call') {
foreach ($sorted as &$val) {
Expand Down Expand Up @@ -3714,7 +3714,7 @@ protected function sortArgs($prototype, $args)
$key = $key[1];

if (empty($key)) {
$posArgs[] = $value;
$posArgs[] = empty($arg[2]) ? $value : $arg;
} else {
$keyArgs[$key] = $value;
}
Expand Down Expand Up @@ -4266,20 +4266,38 @@ protected function libCall($args, $kwargs)
{
$name = $this->compileStringContent($this->coerceString($this->reduce(array_shift($args), true)));

$args = array_map(
function ($a) {
return [null, $a, false];
},
$args
);
$posArgs = [];

foreach ($args as $arg) {
if (empty($arg[0])) {
if ($arg[2] === true) {
$tmp = $this->reduce($arg[1]);

if ($tmp[0] === Type::T_LIST) {
foreach ($tmp[2] as $item) {
$posArgs[] = [null, $item, false];
}
} else {
$posArgs[] = [null, $tmp, true];
}

continue;
}

$posArgs[] = [null, $this->reduce($arg), false];
continue;
}

$posArgs[] = [null, $arg, false];
}

if (count($kwargs)) {
foreach ($kwargs as $key => $value) {
$args[] = [[Type::T_VARIABLE, $key], $value, false];
$posArgs[] = [[Type::T_VARIABLE, $key], $value, false];
}
}

return $this->reduce([Type::T_FUNCTION_CALL, $name, $args]);
return $this->reduce([Type::T_FUNCTION_CALL, $name, $posArgs]);
}

protected static $libIf = ['condition', 'if-true', 'if-false'];
Expand Down Expand Up @@ -4838,7 +4856,7 @@ protected function getNormalizedNumbers($args)
if (null === $unit) {
$unit = $number[2];
$originalUnit = $item->unitStr();
} elseif ($unit !== $number[2]) {
} elseif ($number[1] && $unit !== $number[2]) {
$this->throwError('Incompatible units: "%s" and "%s".', $originalUnit, $item->unitStr());
break;
}
Expand Down Expand Up @@ -4985,7 +5003,21 @@ protected function libMapMerge($args)
$map1 = $this->assertMap($args[0]);
$map2 = $this->assertMap($args[1]);

return [Type::T_MAP, array_merge($map1[1], $map2[1]), array_merge($map1[2], $map2[2])];
foreach ($map2[1] as $i2 => $key2) {
$key = $this->compileStringContent($this->coerceString($key2));

foreach ($map1[1] as $i1 => $key1) {
if ($key === $this->compileStringContent($this->coerceString($key1))) {
$map1[2][$i1] = $map2[2][$i2];
continue 2;
}
}

$map1[1][] = $map2[1][$i2];
$map1[2][] = $map2[2][$i2];
}

return $map1;
}

protected static $libKeywords = ['args'];
Expand Down