N°2226: Upgrade ScssPHP to v1.0.0

This commit is contained in:
Stephen Abello
2019-06-28 14:24:56 +02:00
parent c7fe6f388a
commit a827cb7546
29 changed files with 4152 additions and 1302 deletions

29
lib/scssphp/bin/pscss Normal file → Executable file
View File

@@ -3,11 +3,11 @@
/**
* SCSSPHP
*
* @copyright 2012-2015 Leaf Corcoran
* @copyright 2012-2019 Leaf Corcoran
*
* @license http://opensource.org/licenses/MIT MIT
*
* @link http://leafo.github.io/scssphp
* @link http://scssphp.github.io/scssphp
*/
error_reporting(E_ALL);
@@ -18,9 +18,9 @@ if (version_compare(PHP_VERSION, '5.4') < 0) {
include __DIR__ . '/../scss.inc.php';
use Leafo\ScssPhp\Compiler;
use Leafo\ScssPhp\Parser;
use Leafo\ScssPhp\Version;
use ScssPhp\ScssPhp\Compiler;
use ScssPhp\ScssPhp\Parser;
use ScssPhp\ScssPhp\Version;
$style = null;
$loadPaths = null;
@@ -32,6 +32,7 @@ $debugInfo = false;
$lineNumbers = false;
$ignoreErrors = false;
$encoding = false;
$sourceMap = false;
/**
* Parse argument
@@ -76,7 +77,8 @@ Options include:
-i=path Set import path
--iso8859-1 Use iso8859-1 encoding instead of utf-8 (default utf-8)
--line-numbers Annotate selectors with comments referring to the source file and line number
-p=precision Set decimal number precision (default 5)
-p=precision Set decimal number precision (default 10)
--sourcemap Create source map file
-T Dump formatted parse tree
-v, --version Print the version
@@ -108,6 +110,11 @@ EOT;
continue;
}
if ($argv[$i] === '--sourcemap') {
$sourceMap = true;
continue;
}
if ($argv[$i] === '-T') {
$dumpTree = true;
continue;
@@ -169,11 +176,11 @@ if ($dumpTree) {
$scss = new Compiler();
if ($debugInfo && $inputFile) {
if ($debugInfo) {
$scss->setLineNumberStyle(Compiler::DEBUG_INFO);
}
if ($lineNumbers && $inputFile) {
if ($lineNumbers) {
$scss->setLineNumberStyle(Compiler::LINE_COMMENTS);
}
@@ -190,7 +197,11 @@ if ($precision) {
}
if ($style) {
$scss->setFormatter('Leafo\\ScssPhp\\Formatter\\' . ucfirst($style));
$scss->setFormatter('ScssPhp\\ScssPhp\\Formatter\\' . ucfirst($style));
}
if ($sourceMap) {
$scss->setSourceMap(Compiler::SOURCE_MAP_INLINE);
}
if ($encoding) {