當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。