本文整理汇总了Python中pygments.lexer.Lexer类的典型用法代码示例。如果您正苦于以下问题:Python Lexer类的具体用法?Python Lexer怎么用?Python Lexer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Lexer类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, **options):
self.python3 = get_bool_opt(options, 'python3', False)
if self.python3:
self.aliases = ['ipy3']
else:
self.aliases = ['ipy2', 'ipy']
Lexer.__init__(self, **options)
self.IPythonLexer = IPythonLexer(**options)
self.IPythonConsoleLexer = IPythonConsoleLexer(**options)
示例2: __init__
def __init__(self, **options):
Lexer.__init__(self, **options)
self.keywords = set()
if get_bool_opt(options, 'turbopascal', True):
self.keywords.update(self.TURBO_PASCAL_KEYWORDS)
if get_bool_opt(options, 'delphi', True):
self.keywords.update(self.DELPHI_KEYWORDS)
if get_bool_opt(options, 'freepascal', True):
self.keywords.update(self.FREE_PASCAL_KEYWORDS)
self.builtins = set()
for unit in get_list_opt(options, 'units', list(self.BUILTIN_UNITS)):
self.builtins.update(self.BUILTIN_UNITS[unit])
示例3: __init__
def __init__(self, **options):
self.compress = get_choice_opt(options, 'compress',
['', 'none', 'gz', 'bz2'], '')
Lexer.__init__(self, **options)
示例4: __init__
def __init__(self, baselexer, **options):
self.baselexer = baselexer
Lexer.__init__(self, **options)
示例5: __init__
def __init__(self, **options):
options['tabsize'] = 2
options['encoding'] = 'UTF-8'
Lexer.__init__(self, **options)
示例6: __init__
def __init__(self, **options):
self.python3 = get_bool_opt(options, 'python3', False)
Lexer.__init__(self, **options)
示例7: __init__
def __init__(self, left, right, lang, **options):
self.left = left
self.right = right
self.lang = lang
Lexer.__init__(self, **options)
示例8: __init__
def __init__(self, **options):
self.compress = get_choice_opt(options, "compress", ["", "none", "gz", "bz2"], "")
Lexer.__init__(self, **options)
示例9: __init__
def __init__(self):
Lexer.__init__(self, tabsize=2, encoding='UTF-8')
示例10: __init__
def __init__(self, **options):
from pygments.lexers.agile import RubyLexer
self.ruby_lexer = RubyLexer(**options)
Lexer.__init__(self, **options)
示例11: __init__
def __init__(self, **options):
self.options = options
Lexer.__init__(self, **options)