Refactor
This commit is contained in:
parent
fde01a6cf1
commit
670d58c505
1 changed files with 4 additions and 6 deletions
|
@ -71,26 +71,24 @@ module.exports = (function() {
|
||||||
|
|
||||||
function matchGradient(gradientType, pattern, orientationMatcher) {
|
function matchGradient(gradientType, pattern, orientationMatcher) {
|
||||||
return matchCall(pattern, function(captures) {
|
return matchCall(pattern, function(captures) {
|
||||||
orientation = orientationMatcher();
|
|
||||||
|
var orientation = orientationMatcher();
|
||||||
if (orientation) {
|
if (orientation) {
|
||||||
if (!scan(tokens.comma)) {
|
if (!scan(tokens.comma)) {
|
||||||
error('Missing comma before color stops');
|
error('Missing comma before color stops');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
colorStops = matchListing(matchColorStop);
|
|
||||||
return {
|
return {
|
||||||
type: gradientType,
|
type: gradientType,
|
||||||
orientation: orientation,
|
orientation: orientation,
|
||||||
colorStops: colorStops
|
colorStops: matchListing(matchColorStop)
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function matchCall(pattern, callback) {
|
function matchCall(pattern, callback) {
|
||||||
var captures = scan(pattern),
|
var captures = scan(pattern);
|
||||||
orientation,
|
|
||||||
colorStops;
|
|
||||||
|
|
||||||
if (captures) {
|
if (captures) {
|
||||||
if (!scan(tokens.startCall)) {
|
if (!scan(tokens.startCall)) {
|
||||||
|
|
Loading…
Reference in a new issue