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


Python symbol.compound_stmt方法代码示例

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


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

示例1: Annotate

# 需要导入模块: import symbol [as 别名]
# 或者: from symbol import compound_stmt [as 别名]
def Annotate(cls, symbol_type, children):
    if symbol_type != symbol.stmt:
      return None

    compound_statement = children[0]
    if compound_statement.type != symbol.compound_stmt:
      return None

    statement = compound_statement.children[0]
    if statement.type == symbol.funcdef:
      return cls(statement.type, statement.children)
    elif (statement.type == symbol.decorated and
          statement.children[-1].type == symbol.funcdef):
      return cls(statement.type, statement.children)
    else:
      return None 
开发者ID:FSecureLABS,项目名称:Jandroid,代码行数:18,代码来源:function_definition.py

示例2: Annotate

# 需要导入模块: import symbol [as 别名]
# 或者: from symbol import compound_stmt [as 别名]
def Annotate(cls, symbol_type, children):
    if symbol_type != symbol.stmt:
      return None

    compound_statement = children[0]
    if compound_statement.type != symbol.compound_stmt:
      return None

    statement = compound_statement.children[0]
    if statement.type == symbol.classdef:
      return cls(statement.type, statement.children)
    elif (statement.type == symbol.decorated and
          statement.children[-1].type == symbol.classdef):
      return cls(statement.type, statement.children)
    else:
      return None 
开发者ID:FSecureLABS,项目名称:Jandroid,代码行数:18,代码来源:class_definition.py

示例3: single_input

# 需要导入模块: import symbol [as 别名]
# 或者: from symbol import compound_stmt [as 别名]
def single_input(self, node):
        ### do we want to do anything about being "interactive" ?

        # NEWLINE | simple_stmt | compound_stmt NEWLINE
        n = node[0][0]
        if n != token.NEWLINE:
            return self.com_stmt(node[0])

        return Pass() 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:11,代码来源:transformer.py

示例4: com_node

# 需要导入模块: import symbol [as 别名]
# 或者: from symbol import compound_stmt [as 别名]
def com_node(self, node):
        # Note: compile.c has handling in com_node for del_stmt, pass_stmt,
        #       break_stmt, stmt, small_stmt, flow_stmt, simple_stmt,
        #       and compound_stmt.
        #       We'll just dispatch them.
        return self._dispatch[node[0]](node[1:]) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:8,代码来源:transformer.py


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