Пример #1
0
    def __init__(self, **options):
        level = get_choice_opt(options, 'unicodelevel', list(self.tokens.keys()), '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)
Пример #2
0
    def __init__(self, **options):
        level = get_choice_opt(options, 'unicodelevel',
                               list(self.tokens.keys()), '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)
Пример #3
0
 def __init__(self, **options):
     from pygments3.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)
Пример #4
0
    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 pygments3.lexers._phpbuiltins import MODULES

            for key, value in MODULES.items():
                if key not in self.disabledmodules:
                    self._functions.update(value)
        RegexLexer.__init__(self, **options)
Пример #5
0
    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 pygments3.lexers._phpbuiltins import MODULES
            for key, value in MODULES.items():
                if key not in self.disabledmodules:
                    self._functions.update(value)
        RegexLexer.__init__(self, **options)