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/c_cpp.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/c_cpp.py')
| -rw-r--r-- | pygments/lexers/c_cpp.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pygments/lexers/c_cpp.py b/pygments/lexers/c_cpp.py index e676a8af..5d84a377 100644 --- a/pygments/lexers/c_cpp.py +++ b/pygments/lexers/c_cpp.py @@ -144,21 +144,21 @@ class CFamilyLexer(RegexLexer): ] } - stdlib_types = set(( + stdlib_types = { 'size_t', 'ssize_t', 'off_t', 'wchar_t', 'ptrdiff_t', 'sig_atomic_t', 'fpos_t', 'clock_t', 'time_t', 'va_list', 'jmp_buf', 'FILE', 'DIR', 'div_t', 'ldiv_t', - 'mbstate_t', 'wctrans_t', 'wint_t', 'wctype_t')) - c99_types = set(( + 'mbstate_t', 'wctrans_t', 'wint_t', 'wctype_t'} + c99_types = { '_Bool', '_Complex', 'int8_t', 'int16_t', 'int32_t', 'int64_t', 'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t', 'int_least8_t', 'int_least16_t', 'int_least32_t', 'int_least64_t', 'uint_least8_t', 'uint_least16_t', 'uint_least32_t', 'uint_least64_t', 'int_fast8_t', 'int_fast16_t', 'int_fast32_t', 'int_fast64_t', 'uint_fast8_t', 'uint_fast16_t', 'uint_fast32_t', 'uint_fast64_t', - 'intptr_t', 'uintptr_t', 'intmax_t', 'uintmax_t')) - linux_types = set(( + 'intptr_t', 'uintptr_t', 'intmax_t', 'uintmax_t'} + linux_types = { 'clockid_t', 'cpu_set_t', 'cpumask_t', 'dev_t', 'gid_t', 'id_t', 'ino_t', 'key_t', 'mode_t', 'nfds_t', 'pid_t', 'rlim_t', 'sig_t', 'sighandler_t', 'siginfo_t', - 'sigset_t', 'sigval_t', 'socklen_t', 'timer_t', 'uid_t')) + 'sigset_t', 'sigval_t', 'socklen_t', 'timer_t', 'uid_t'} def __init__(self, **options): self.stdlibhighlighting = get_bool_opt(options, 'stdlibhighlighting', True) |
