gonzales-pe
Advanced tools
Comparing version 2.0.0 to 2.0.1
Gonzales changelog | ||
================== | ||
18.11.2013, Version 2.0.1 | ||
------------------------- | ||
- Bring back lost whitespaces and comments | ||
11.11.2013, Version 2.0.0 | ||
@@ -5,0 +9,0 @@ ------------------------- |
@@ -6,3 +6,3 @@ function astToCSS(options) { | ||
hasInfo = typeof tree[0] === 'object'; | ||
syntax = options.syntax; | ||
syntax = options.syntax || 'css'; | ||
var _m_simple = { | ||
@@ -14,9 +14,11 @@ 'attrselector': 1, 'combinator': 1, 'ident': 1, 'nth': 1, 'number': 1, | ||
'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1,'condition': 1, | ||
'dimension': 1, 'filterv': 1, 'include': 1, 'loop': 1, 'mixin': 1, | ||
'selector': 1, 'progid': 1, 'property': 1, 'ruleset': 1, | ||
'simpleselector': 1, 'stylesheet': 1, 'value': 1 | ||
'declaration': 1, 'dimension': 1, 'filterv': 1, 'include': 1, | ||
'loop': 1, 'mixin': 1, 'selector': 1, 'progid': 1, 'property': 1, | ||
'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1, 'value': 1 | ||
}, | ||
_m_primitive = { | ||
'cdc': 'cdc', 'cdo': 'cdo', 'decldelim': ';', 'delim': ',', | ||
'namespace': '|', 'parentselector': '&' | ||
'cdc': 'cdc', 'cdo': 'cdo', | ||
'declDelim': syntax === 'sass' ? '\n' : ';', | ||
'delim': ',', | ||
'namespace': '|', 'parentselector': '&', 'propertyDelim' : ':' | ||
}; | ||
@@ -53,3 +55,3 @@ function _t(tree) { | ||
'block': function(t) { | ||
return '{' + _composite(t) + '}'; | ||
return syntax === 'sass' ? _composite(t) : '{' + _composite(t) + '}'; | ||
}, | ||
@@ -63,3 +65,3 @@ 'braces': function(t) { | ||
'commentML': function (t) { | ||
return '/*' + t[hasInfo? 2 : 1] + '*/'; | ||
return '/*' + t[hasInfo? 2 : 1] + (syntax === 'sass' ? '' : '*/'); | ||
}, | ||
@@ -69,8 +71,8 @@ 'commentSL': function (t) { | ||
}, | ||
'declaration': function(t) { | ||
return _t(t[hasInfo? 2 : 1]) + ':' + _t(t[hasInfo? 3 : 2]); | ||
}, | ||
'default': function(t) { | ||
return '!' + _composite(t) + 'default'; | ||
}, | ||
'escapedString': function(t) { | ||
return '~' + t[hasInfo? 2 : 1]; | ||
}, | ||
'filter': function(t) { | ||
@@ -89,3 +91,3 @@ return _t(t[hasInfo? 2 : 1]) + ':' + _t(t[hasInfo? 3 : 2]); | ||
'interpolatedVariable': function(t) { | ||
return (syntax === 'scss' ? '#\{$' : '@{') + _t(t[hasInfo? 2 : 1]) + '}'; | ||
return (syntax === 'less' ? '@{' : '#\{$') + _t(t[hasInfo? 2 : 1]) + '}'; | ||
}, | ||
@@ -114,3 +116,3 @@ 'nthselector': function(t) { | ||
'variable': function(t) { | ||
return (syntax === 'scss' ? '$' : '@') + _t(t[hasInfo? 2 : 1]); | ||
return (syntax === 'less' ? '@' : '$') + _t(t[hasInfo? 2 : 1]); | ||
}, | ||
@@ -117,0 +119,0 @@ 'variableslist': function(t) { |
{ | ||
"name": "gonzales-pe", | ||
"description": "Gonzales Preprocessor Edition (fast CSS parser)", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"homepage": "http://github.com/tonyganch/gonzales-pe", | ||
@@ -6,0 +6,0 @@ "bugs": "http://github.com/tonyganch/gonzales-pe/issues", |
@@ -6,3 +6,3 @@ function astToCSS(options) { | ||
hasInfo = typeof tree[0] === 'object'; | ||
syntax = options.syntax; | ||
syntax = options.syntax || 'css'; | ||
var _m_simple = { | ||
@@ -14,9 +14,11 @@ 'attrselector': 1, 'combinator': 1, 'ident': 1, 'nth': 1, 'number': 1, | ||
'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1,'condition': 1, | ||
'dimension': 1, 'filterv': 1, 'include': 1, 'loop': 1, 'mixin': 1, | ||
'selector': 1, 'progid': 1, 'property': 1, 'ruleset': 1, | ||
'simpleselector': 1, 'stylesheet': 1, 'value': 1 | ||
'declaration': 1, 'dimension': 1, 'filterv': 1, 'include': 1, | ||
'loop': 1, 'mixin': 1, 'selector': 1, 'progid': 1, 'property': 1, | ||
'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1, 'value': 1 | ||
}, | ||
_m_primitive = { | ||
'cdc': 'cdc', 'cdo': 'cdo', 'decldelim': ';', 'delim': ',', | ||
'namespace': '|', 'parentselector': '&' | ||
'cdc': 'cdc', 'cdo': 'cdo', | ||
'declDelim': syntax === 'sass' ? '\n' : ';', | ||
'delim': ',', | ||
'namespace': '|', 'parentselector': '&', 'propertyDelim' : ':' | ||
}; | ||
@@ -53,3 +55,3 @@ function _t(tree) { | ||
'block': function(t) { | ||
return '{' + _composite(t) + '}'; | ||
return syntax === 'sass' ? _composite(t) : '{' + _composite(t) + '}'; | ||
}, | ||
@@ -63,3 +65,3 @@ 'braces': function(t) { | ||
'commentML': function (t) { | ||
return '/*' + t[hasInfo? 2 : 1] + '*/'; | ||
return '/*' + t[hasInfo? 2 : 1] + (syntax === 'sass' ? '' : '*/'); | ||
}, | ||
@@ -69,8 +71,8 @@ 'commentSL': function (t) { | ||
}, | ||
'declaration': function(t) { | ||
return _t(t[hasInfo? 2 : 1]) + ':' + _t(t[hasInfo? 3 : 2]); | ||
}, | ||
'default': function(t) { | ||
return '!' + _composite(t) + 'default'; | ||
}, | ||
'escapedString': function(t) { | ||
return '~' + t[hasInfo? 2 : 1]; | ||
}, | ||
'filter': function(t) { | ||
@@ -89,3 +91,3 @@ return _t(t[hasInfo? 2 : 1]) + ':' + _t(t[hasInfo? 3 : 2]); | ||
'interpolatedVariable': function(t) { | ||
return (syntax === 'scss' ? '#\{$' : '@{') + _t(t[hasInfo? 2 : 1]) + '}'; | ||
return (syntax === 'less' ? '@{' : '#\{$') + _t(t[hasInfo? 2 : 1]) + '}'; | ||
}, | ||
@@ -114,3 +116,3 @@ 'nthselector': function(t) { | ||
'variable': function(t) { | ||
return (syntax === 'scss' ? '$' : '@') + _t(t[hasInfo? 2 : 1]); | ||
return (syntax === 'less' ? '@' : '$') + _t(t[hasInfo? 2 : 1]); | ||
}, | ||
@@ -117,0 +119,0 @@ 'variableslist': function(t) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
409477
10345