1
  €    // Typography

.text-emphasis-variant(@color) {
  color: @color;
  a&:hover,
  a&:focus {
    color: darken(@color, 10%);
  }
}
 ?÷     # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

r"""Code to validate and convert settings of the Microsoft build tools.

This file contains code to validate and convert settings of the Microsoft
build tools.  The function ConvertToMSBuildSettings(), ValidateMSVSSettings(),
and ValidateMSBuildSettings() are the entry points.

This file was created by comparing the projects created by Visual Studio 2008
and Visual Studio 2010 for all available settings through the user interface.
The MSBuild schemas were also considered.  They are typically found in the
MSBuild install directory, e.g. c:\Program Files (x86)\MSBuild
"""

from __future__ import print_function

import sys
import re

try:
  # basestring was removed in python3.
  basestring
except NameError:
  basestring = str

# Dictionaries of settings validators. The key is the tool name, the value is
# a dictionary mapping setting names to validation functions.
_msvs_validators = {}
_msbuild_validators = {}


# A dictionary of settings converters. The key is the tool name, the value is
# a dictionary mapping setting names to conversion functions.
_msvs_to_msbuild_converters = {}


# Tool name mapping from MSVS to MSBuild.
_msbuild_name_of_tool = {}


class _Tool(object):
  """Represents a tool used by MSVS or MSBuild.

  Attributes:
      msvs_name: The name of the tool in MSVS.
      msbuild_name: The name of the tool in MSBuild.
  """

  def __init__(self, msvs_name, msbuild_name):
    self.msvs_name = msvs_name
    self.msbuild_name = msbuild_name


def _AddTool(tool):
  """Adds a tool to the four dictionaries used to process settings.

  This only defines the tool.  Each setting also needs to be added.

  Args:
    tool: The _Tool object to be added.
  """
  _msvs_validators[tool.msvs_name] = {}
  _msbuild_validators[tool.msbuild_name] = {}
  _msvs_to_msbuild_converters[tool.msvs_name] = {}
  _msbuild_name_of_tool[tool.msvs_name] = tool.msbuild_name


def _GetMSBuildToolSettings(msbuild_settings, tool):
  """Returns an MSBuild tool dictionary.  Creates it if needed."""
  return msbuild_settings.setdefault(tool.msbuild_name, {})


class _Type(object):
  """Type of settings (Base class)."""

  def ValidateMSVS(self, value):
    """Verifies that the value is legal for MSVS.

    Args:
      value: the value to check for this type.

    Raises:
      ValueError if value is not valid for MSVS.
    """

  def ValidateMSBuild(self, value):
    """Verifies that the value is legal for MSBuild.

    Args:
      value: the value to check for this type.

    Raises:
      ValueError if value is not valid for MSBuild.
    """

  def ConvertToMSBuild(self, value):
    """Returns the MSBuild equivalent of the MSVS value given.

    Args:
      value: the MSVS value to convert.

    Returns:
      the MSBuild equivalent.

    Raises:
      ValueError if value is not valid.
    """
    return value


class _String(_Type):
  """A setting that's just a string."""

  def ValidateMSVS(self, value):
    if not isinstance(value, basestring):
      raise ValueError('expected string; got %r' % value)

  def ValidateMSBuild(self, value):
    if not isinstance(value, basestring):
      raise ValueError('expected string; got %r' % value)

  def ConvertToMSBuild(self, value):
    # Convert the macros
    return ConvertVCMacrosToMSBuild(value)


class _StringList(_Type):
  """A settings that's a list of strings."""

  def ValidateMSVS(self, value):
    if not isinstance(value, basestring) and not isinstance(value, list):
      raise ValueError('expected string list; got %r' % value)

  def ValidateMSBuild(self, value):
    if not isinstance(value, basestring) and not isinstance(value, list):
      raise ValueError('expected string list; got %r' % value)

  def ConvertToMSBuild(self, value):
    # Convert the macros
    if isinstance(value, list):
