def _AddSources(sources, base_path, base_path_components, result):
  # NOTE: gyp paths are always posix style.
  for source in sources:
    if not len(source) or source.startswith('!!!') or source.startswith('$'):
      continue
    # variable expansion may lead to //.
    org_source = source
    source = source[0] + source[1:].replace('//', '/')
    if source.startswith('../'):
      source = _ResolveParent(source, base_path_components)
      if len(source):
        result.append(source)
      continue
    result.append(base_path + source)
    if debug:
      print 'AddSource', org_source, result[len(result) - 1]
Extracts valid sources from |sources| and adds them to |result|. Each
dataset/ETHPy150Open adblockplus/gyp/pylib/gyp/generator/analyzer.py/_AddSources