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


Python RegexLexer.__init__方法代码示例

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


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

示例1: __init__

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

        RegexLexer.__init__(self, **options)
开发者ID:spencerlyon2,项目名称:pygments,代码行数:9,代码来源:textedit.py

示例2: __init__

# 需要导入模块: from pygments.lexer import RegexLexer [as 别名]
# 或者: from pygments.lexer.RegexLexer import __init__ [as 别名]
 def __init__(self, **options):
     level = options.get('i6t', '+i6t-not-inline')
     if level not in self._all_tokens:
         self._tokens = self.__class__.process_tokendef(level)
     else:
         self._tokens = self._all_tokens[level]
     RegexLexer.__init__(self, **options)
开发者ID:spencerlyon2,项目名称:pygments,代码行数:9,代码来源:int_fiction.py

示例3: __init__

# 需要导入模块: from pygments.lexer import RegexLexer [as 别名]
# 或者: from pygments.lexer.RegexLexer import __init__ [as 别名]
    def __init__(self, **options):
        level = get_choice_opt(options, 'unicodelevel', list(self.tokens), 'basic')
        if level not in self._all_tokens:
            # compile the regexes now
            self._tokens = self.__class__.process_tokendef(level)
        else:
            self._tokens = self._all_tokens[level]

        RegexLexer.__init__(self, **options)
开发者ID:0038lana,项目名称:Test-Task,代码行数:11,代码来源:dotnet.py

示例4: __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._sourcemodbuiltins import FUNCTIONS
            self._functions.update(FUNCTIONS)
        RegexLexer.__init__(self, **options)
开发者ID:spencerlyon2,项目名称:pygments,代码行数:11,代码来源:pawn.py

示例5: __init__

# 需要导入模块: from pygments.lexer import RegexLexer [as 别名]
# 或者: from pygments.lexer.RegexLexer import __init__ [as 别名]
 def __init__(self, **options):
     from pygments.lexers._clbuiltins 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:Mekyi,项目名称:crunchy,代码行数:14,代码来源:functional.py

示例6: __init__

# 需要导入模块: from pygments.lexer import RegexLexer [as 别名]
# 或者: from pygments.lexer.RegexLexer import __init__ [as 别名]
    def __init__(self, **options):
        self.func_name_highlighting = get_bool_opt(
            options, 'func_name_highlighting', True)
        self.disabled_modules = get_list_opt(options, 'disabled_modules', [])

        self._functions = set()
        if self.func_name_highlighting:
            from pygments.lexers._lua_builtins import MODULES
            for mod, func in MODULES.iteritems():
                if mod not in self.disabled_modules:
                    self._functions.update(func)
        RegexLexer.__init__(self, **options)
开发者ID:marvin-h,项目名称:tarantool,代码行数:14,代码来源:LuaLexer.py

示例7: __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:knossos-project,项目名称:PythonQt,代码行数:16,代码来源:javascript.py

示例8: __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._phpbuiltins import MODULES

            for key, value in MODULES.iteritems():
                if key not in self.disabledmodules:
                    self._functions.update(value)
        RegexLexer.__init__(self, **options)
开发者ID:dlutcat,项目名称:pastebin,代码行数:20,代码来源:web.py

示例9: __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:axil,项目名称:blog,代码行数:21,代码来源:php.py

示例10: __init__

# 需要导入模块: from pygments.lexer import RegexLexer [as 别名]
# 或者: from pygments.lexer.RegexLexer import __init__ [as 别名]
 def __init__(self, **options):
     self.reserved_words = set()
     self.pervasives = set()
     # ISO Modula-2
     if get_bool_opt(options, 'iso', False):
         self.reserved_words.update(self.iso_reserved_words)
         self.pervasives.update(self.iso_pervasives)
     # Objective Modula-2
     elif get_bool_opt(options, 'objm2', False):
         self.reserved_words.update(self.objm2_reserved_words)
         self.pervasives.update(self.objm2_pervasives)
     # PIM Modula-2 (DEFAULT)
     else:
         self.reserved_words.update(self.pim_reserved_words)
         self.pervasives.update(self.pim_pervasives)
     # GNU extensions
     if get_bool_opt(options, 'gm2ext', False):
         self.reserved_words.update(self.gnu_reserved_words)
         self.pervasives.update(self.gnu_pervasives)
     # initialise
     RegexLexer.__init__(self, **options)
开发者ID:2015E8014661092,项目名称:jinjaysnow.github.io,代码行数:23,代码来源:pascal.py

示例11: __init__

# 需要导入模块: from pygments.lexer import RegexLexer [as 别名]
# 或者: from pygments.lexer.RegexLexer import __init__ [as 别名]
 def __init__(self, **options):
     self.stdlibhighlighting = get_bool_opt(options, 'stdlibhighlighting', True)
     self.c99highlighting = get_bool_opt(options, 'c99highlighting', True)
     self.platformhighlighting = get_bool_opt(options, 'platformhighlighting', True)
     RegexLexer.__init__(self, **options)
开发者ID:LihMeh,项目名称:outwiker,代码行数:7,代码来源:c_cpp.py

示例12: __init__

# 需要导入模块: from pygments.lexer import RegexLexer [as 别名]
# 或者: from pygments.lexer.RegexLexer import __init__ [as 别名]
 def __init__(self, **options):
     self.handlecodeblocks = get_bool_opt(options, 'handlecodeblocks', True)
     RegexLexer.__init__(self, **options)
开发者ID:achernet,项目名称:wxPython,代码行数:5,代码来源:text.py

示例13: __init__

# 需要导入模块: from pygments.lexer import RegexLexer [as 别名]
# 或者: from pygments.lexer.RegexLexer import __init__ [as 别名]
 def __init__(self, **options):
     RegexLexer.__init__(self, **options)
     self.add_filter(DocFilter())
开发者ID:metaborg,项目名称:metaborg-pygments,代码行数:5,代码来源:doc.py


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