plisttool.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:rules_apple 作者: bazelbuild 项目源码 文件源码
def ExtractVariableFromMatch(re_match_obj):
  """Takes a match from VARIABLE_REFERENCE_RE and extracts the variable.

  This funciton is exposed to testing.

  Args:
    re_match_obj: a re.MatchObject
  Returns:
    The variable name (with qualifier attached) or None if the match wasn't
    completely valid.
  """
  expected_close = '}' if re_match_obj.group(1) == '{' else ')'
  if re_match_obj.group(3) == expected_close:
    m = VARIABLE_NAME_RE.match(re_match_obj.group(2))
    if m:
      return m.group(0)
  return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号