diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2019-11-24 12:55:42 -0800 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2019-11-25 12:12:41 +0100 |
commit | 1dc6c8e2b473717188632f9a0c28c4342428e684 (patch) | |
tree | d57a8c8cecbf2388b4fa15bb77dd4d8b8363de15 /pygments/lexers/lisp.py | |
parent | fdbe9c57ce3cc1f5d31a9fc74e7e94314d69773b (diff) | |
download | pygments-git-1dc6c8e2b473717188632f9a0c28c4342428e684.tar.gz |
Update project to use modern Python features and idioms
Run the pyupgrade tool across the project to use modern language
features.
- Use set literals
- Use dict comprehension
- Remove unnecessary numeric indexes in format string
- Remove unnecessary extra parentheses
Diffstat (limited to 'pygments/lexers/lisp.py')
-rw-r--r-- | pygments/lexers/lisp.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/pygments/lexers/lisp.py b/pygments/lexers/lisp.py index 9eda4d55..601d5a5f 100644 --- a/pygments/lexers/lisp.py +++ b/pygments/lexers/lisp.py @@ -1554,7 +1554,7 @@ class EmacsLispLexer(RegexLexer): # Take a deep breath... symbol = r'((?:%s)(?:%s)*)' % (nonmacro, constituent) - macros = set(( + macros = { 'atomic-change-group', 'case', 'block', 'cl-block', 'cl-callf', 'cl-callf2', 'cl-case', 'cl-decf', 'cl-declaim', 'cl-declare', 'cl-define-compiler-macro', 'cl-defmacro', 'cl-defstruct', @@ -1601,17 +1601,17 @@ class EmacsLispLexer(RegexLexer): 'with-tramp-file-property', 'with-tramp-progress-reporter', 'with-wrapper-hook', 'load-time-value', 'locally', 'macrolet', 'progv', 'return-from', - )) + } - special_forms = set(( + special_forms = { 'and', 'catch', 'cond', 'condition-case', 'defconst', 'defvar', 'function', 'if', 'interactive', 'let', 'let*', 'or', 'prog1', 'prog2', 'progn', 'quote', 'save-current-buffer', 'save-excursion', 'save-restriction', 'setq', 'setq-default', 'subr-arity', 'unwind-protect', 'while', - )) + } - builtin_function = set(( + builtin_function = { '%', '*', '+', '-', '/', '/=', '1+', '1-', '<', '<=', '=', '>', '>=', 'Snarf-documentation', 'abort-recursive-edit', 'abs', 'accept-process-output', 'access-file', 'accessible-keymaps', 'acos', @@ -2051,23 +2051,23 @@ class EmacsLispLexer(RegexLexer): 'xw-color-values', 'xw-display-color-p', 'xw-display-color-p', 'yes-or-no-p', 'zlib-available-p', 'zlib-decompress-region', 'forward-point', - )) + } - builtin_function_highlighted = set(( + builtin_function_highlighted = { 'defvaralias', 'provide', 'require', 'with-no-warnings', 'define-widget', 'with-electric-help', 'throw', 'defalias', 'featurep' - )) + } - lambda_list_keywords = set(( + lambda_list_keywords = { '&allow-other-keys', '&aux', '&body', '&environment', '&key', '&optional', '&rest', '&whole', - )) + } - error_keywords = set(( + error_keywords = { 'cl-assert', 'cl-check-type', 'error', 'signal', 'user-error', 'warn', - )) + } def get_tokens_unprocessed(self, text): stack = ['root'] @@ -2226,7 +2226,7 @@ class ShenLexer(RegexLexer): BUILTINS_ANYWHERE = ('where', 'skip', '>>', '_', '!', '<e>', '<!>') - MAPPINGS = dict((s, Keyword) for s in DECLARATIONS) + MAPPINGS = {s: Keyword for s in DECLARATIONS} MAPPINGS.update((s, Name.Builtin) for s in BUILTINS) MAPPINGS.update((s, Keyword) for s in SPECIAL_FORMS) |