當前位置: 首頁>>代碼示例>>Python>>正文


Python RegexLexer.__init__方法代碼示例

本文整理匯總了Python中pygments.lexer.RegexLexer.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python RegexLexer.__init__方法的具體用法?Python RegexLexer.__init__怎麽用?Python RegexLexer.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pygments.lexer.RegexLexer的用法示例。


在下文中一共展示了RegexLexer.__init__方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from pygments.lexer import RegexLexer [as 別名]
# 或者: from pygments.lexer.RegexLexer import __init__ [as 別名]
def __init__(self, **options):
        self.funcnamehighlighting = get_bool_opt(
            options, 'funcnamehighlighting', True)
        self.disabledmodules = get_list_opt(
            options, 'disabledmodules', ['unknown'])
        self.startinline = get_bool_opt(options, 'startinline', False)

        # private option argument for the lexer itself
        if '_startinline' in options:
            self.startinline = options.pop('_startinline')

        # collect activated functions in a set
        self._functions = set()
        if self.funcnamehighlighting:
            from pygments.lexers._php_builtins import MODULES
            for key, value in iteritems(MODULES):
                if key not in self.disabledmodules:
                    self._functions.update(value)
        RegexLexer.__init__(self, **options) 
開發者ID:joxeankoret,項目名稱:pigaios,代碼行數:21,代碼來源:php.py

示例2: __init__

# 需要導入模塊: from pygments.lexer import RegexLexer [as 別名]
# 或者: from pygments.lexer.RegexLexer import __init__ [as 別名]
def __init__(self, **options):
        self.builtinshighlighting = get_bool_opt(
            options, 'builtinshighlighting', True)
        self.requiredelimiters = get_bool_opt(
            options, 'requiredelimiters', False)

        self._builtins = set()
        self._members = set()
        if self.builtinshighlighting:
            from pygments.lexers._lasso_builtins import BUILTINS, MEMBERS
            for key, value in iteritems(BUILTINS):
                self._builtins.update(value)
            for key, value in iteritems(MEMBERS):
                self._members.update(value)
        RegexLexer.__init__(self, **options) 
開發者ID:joxeankoret,項目名稱:pigaios,代碼行數:17,代碼來源:javascript.py

示例3: __init__

# 需要導入模塊: from pygments.lexer import RegexLexer [as 別名]
# 或者: from pygments.lexer.RegexLexer import __init__ [as 別名]
def __init__(self, **options):
        self.smhighlighting = get_bool_opt(options,
                                           'sourcemod', True)

        self._functions = set()
        if self.smhighlighting:
            from pygments.lexers._sourcemod_builtins import FUNCTIONS
            self._functions.update(FUNCTIONS)
        RegexLexer.__init__(self, **options) 
開發者ID:joxeankoret,項目名稱:pigaios,代碼行數:11,代碼來源:pawn.py

示例4: __init__

# 需要導入模塊: from pygments.lexer import RegexLexer [as 別名]
# 或者: from pygments.lexer.RegexLexer import __init__ [as 別名]
def __init__(self, **options):
        from pygments.lexers._vim_builtins import command, option, auto
        self._cmd = command
        self._opt = option
        self._aut = auto

        RegexLexer.__init__(self, **options) 
開發者ID:joxeankoret,項目名稱:pigaios,代碼行數:9,代碼來源:textedit.py

示例5: __init__

# 需要導入模塊: from pygments.lexer import RegexLexer [as 別名]
# 或者: from pygments.lexer.RegexLexer import __init__ [as 別名]
def __init__(self, **options):
        from pygments.lexers._cl_builtins import BUILTIN_FUNCTIONS, \
            SPECIAL_FORMS, MACROS, LAMBDA_LIST_KEYWORDS, DECLARATIONS, \
            BUILTIN_TYPES, BUILTIN_CLASSES
        self.builtin_function = BUILTIN_FUNCTIONS
        self.special_forms = SPECIAL_FORMS
        self.macros = MACROS
        self.lambda_list_keywords = LAMBDA_LIST_KEYWORDS
        self.declarations = DECLARATIONS
        self.builtin_types = BUILTIN_TYPES
        self.builtin_classes = BUILTIN_CLASSES
        RegexLexer.__init__(self, **options) 
開發者ID:joxeankoret,項目名稱:pigaios,代碼行數:14,代碼來源:lisp.py

示例6: __init__

# 需要導入模塊: from pygments.lexer import RegexLexer [as 別名]
# 或者: from pygments.lexer.RegexLexer import __init__ [as 別名]
def __init__(self, **options):
        #
        # check dialect options
        #
        dialects = get_list_opt(options, 'dialect', [])
        #
        for dialect_option in dialects:
            if dialect_option in self.dialects[1:-1]:
                # valid dialect option found
                self.set_dialect(dialect_option)
                break
        #
        # Fallback Mode (DEFAULT)
        else:
            # no valid dialect option
            self.set_dialect('unknown')
        #
        self.dialect_set_by_tag = False
        #
        # check style options
        #
        styles = get_list_opt(options, 'style', [])
        #
        # use lowercase mode for Algol style
        if 'algol' in styles or 'algol_nu' in styles:
            self.algol_publication_mode = True
        else:
            self.algol_publication_mode = False
        #
        # Check option flags
        #
        self.treat_stdlib_adts_as_builtins = get_bool_opt(
            options, 'treat_stdlib_adts_as_builtins', True)
        #
        # call superclass initialiser
        RegexLexer.__init__(self, **options)

    # Set lexer to a specified dialect 
開發者ID:luckystarufo,項目名稱:pySINDy,代碼行數:40,代碼來源:modula2.py

示例7: __init__

# 需要導入模塊: from pygments.lexer import RegexLexer [as 別名]
# 或者: from pygments.lexer.RegexLexer import __init__ [as 別名]
def __init__(self, **options):
        self.body_lexer = options.get('body_lexer', None)
        RegexLexer.__init__(self, **options) 
開發者ID:pygments,項目名稱:pygments,代碼行數:5,代碼來源:textfmts.py


注:本文中的pygments.lexer.RegexLexer.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。