func mergeExprs(src, dst bzl.Expr) (bzl.Expr, error) {
	if ShouldKeep(dst) {
		return nil, nil
	}
	if src == nil && (dst == nil || isScalar(dst)) {
		return nil, nil
	}
	if isScalar(src) {
		return src, nil
	}

	srcExprs, err := extractPlatformStringsExprs(src)
	if err != nil {
		return nil, err
	}
	dstExprs, err := extractPlatformStringsExprs(dst)
	if err != nil {
		return nil, err
	}
	mergedExprs, err := mergePlatformStringsExprs(srcExprs, dstExprs)
	if err != nil {
		return nil, err
	}
	return makePlatformStringsExpr(mergedExprs), nil
}
func mergeExprs(src, dst bzl.Expr) (bzl.Expr, error) {
	if ShouldKeep(dst) {
		return nil, nil
	}
	if src == nil && (dst == nil || isScalar(dst)) {
		return nil, nil
	}
	if isScalar(src) {
		return src, nil
	}

	srcExprs, err := extractPlatformStringsExprs(src)
	if err != nil {
		return nil, err
	}
	dstExprs, err := extractPlatformStringsExprs(dst)
	if err != nil {
		return nil, err
	}
	mergedExprs, err := mergePlatformStringsExprs(srcExprs, dstExprs)
	if err != nil {
		return nil, err
	}
	return makePlatformStringsExpr(mergedExprs), nil
}
func mergeExprs ( src , dst bzl . Expr ) ( bzl . Expr , error ) { if ShouldKeep ( dst ) { return nil , nil } if src == nil && ( dst == nil || isScalar ( dst ) ) { return nil , nil } if isScalar ( src ) { return src , nil } srcExprs , err := extractPlatformStringsExprs ( src ) if err != nil { return nil , err } dstExprs , err := extractPlatformStringsExprs ( dst ) if err != nil { return nil , err } mergedExprs , err := mergePlatformStringsExprs ( srcExprs , dstExprs ) if err != nil { return nil , err } return makePlatformStringsExpr ( mergedExprs ) , nil }
// mergeExprs combines information from src and dst and returns a merged
// expression. dst may be modified during this process. The returned expression
// may be different from dst when a structural change is needed.
//
// The following kinds of expressions are recognized.
//
//   * nil
//   * strings (can only be merged with strings)
//   * lists of strings
//   * a call to select with a dict argument. The dict keys must be strings,
//     and the values must be lists of strings.
//   * a list of strings combined with a select call using +. The list must
//     be the left operand.
//
// An error is returned if the expressions can't be merged, for example
// because they are not in one of the above formats.
mergeExprs combines information from src and dst and returns a merged expression . dst may be modified during this process . The returned expression may be different from dst when a structural change is needed . The following kinds of expressions are recognized . * nil * strings ( can only be merged with strings ) * lists of strings * a call to select with a dict argument . The dict keys must be strings and the values must be lists of strings . * a list of strings combined with a select call using + . The list must be the left operand . An error is returned if the expressions can t be merged for example because they are not in one of the above formats .