当前位置: 首页>>代码示例>>C++>>正文


C++ FunctionScopePtr::getScopeName方法代码示例

本文整理汇总了C++中FunctionScopePtr::getScopeName方法的典型用法代码示例。如果您正苦于以下问题:C++ FunctionScopePtr::getScopeName方法的具体用法?C++ FunctionScopePtr::getScopeName怎么用?C++ FunctionScopePtr::getScopeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FunctionScopePtr的用法示例。


在下文中一共展示了FunctionScopePtr::getScopeName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addFunction

bool FileScope::addFunction(AnalysisResultConstPtr ar,
                            FunctionScopePtr funcScope) {
    if (ar->declareFunction(funcScope)) {
        FunctionScopePtr &fs = m_functions[funcScope->getScopeName()];
        if (fs) {
            if (!m_redeclaredFunctions) {
                m_redeclaredFunctions = new StringToFunctionScopePtrVecMap;
            }
            auto& funcVec = (*m_redeclaredFunctions)[funcScope->getScopeName()];
            if (!funcVec.size()) {
                fs->setLocalRedeclaring();
                funcVec.push_back(fs);
            }
            funcScope->setLocalRedeclaring();
            funcVec.push_back(funcScope);
        } else {
            fs = funcScope;
        }
        return true;
    }
    return false;
}
开发者ID:shixiao,项目名称:hhvm,代码行数:22,代码来源:file_scope.cpp

示例2: declareFunction

bool AnalysisResult::declareFunction(FunctionScopePtr funcScope) const {
  assert(m_phase < AnalyzeAll);

  // System functions override
  auto it = m_functions.find(funcScope->getScopeName());
  if (it != m_functions.end()) {
    // we need someone to hold on to a reference to it
    // even though we're not going to do anything with it
    this->lock()->m_ignoredScopes.push_back(funcScope);

    std::string msg;
    string_printf(
      msg,
      Strings::REDECLARE_BUILTIN,
      funcScope->getScopeName().c_str()
    );
    funcScope->setFatal(msg);
    return false;
  }

  return true;
}
开发者ID:SiebelsTim,项目名称:hhvm,代码行数:22,代码来源:analysis_result.cpp

示例3: addFunction

bool ClassScope::addFunction(AnalysisResultConstPtr ar,
                             FileScopeRawPtr fileScope,
                             FunctionScopePtr funcScope) {
  FunctionScopePtr &func = m_functions[funcScope->getScopeName()];
  if (func) {
    func->getStmt()->parseTimeFatal(fileScope,
                                    Compiler::DeclaredMethodTwice,
                                    "Redeclared method %s::%s",
                                    getScopeName().c_str(),
                                    func->getScopeName().c_str());
  }
  func = funcScope;
  m_functionsVec.push_back(funcScope);
  return true;
}
开发者ID:orok,项目名称:hhvm,代码行数:15,代码来源:class_scope.cpp

示例4: declareFunction

bool AnalysisResult::declareFunction(FunctionScopePtr funcScope) const {
  assert(m_phase < AnalyzeAll);

  // System functions override
  auto it = m_functions.find(funcScope->getScopeName());
  if (it != m_functions.end()) {
    if (!it->second->allowOverride()) {
      // we need someone to hold on to a reference to it
      // even though we're not going to do anything with it
      this->lock()->m_ignoredScopes.push_back(funcScope);
      return false;
    }
  }

  return true;
}
开发者ID:Globalcherry,项目名称:hhvm,代码行数:16,代码来源:analysis_result.cpp


注:本文中的FunctionScopePtr::getScopeName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。