Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Denning <gfxcoder>2022-04-21 05:30:14 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-04-21 12:09:06 +0300
commit81de1e7d4d272d2c163b6fc94b3d4d92b596caed (patch)
tree07a30fff0ef9b79c1a78a038e42422d0e35e00ba /build_files/cmake/cmake_static_check_splint.py
parent8fb03c9e27e8ae937730669b0df87522b929edcb (diff)
Text Editor: add Python 3.10 soft keywords to `builtinfunc` list
Python 3.10 has added "soft keywords" [0] to their list of identifiers. This patch adds these soft keywords to the list of builtin functions that the text editor searches for when highlighting Python code. The only soft keywords that Python 3.10 current has are: `match`, `case`, and `_`, but more will likely be added in future versions. Currently, the `_` soft keyword is ignored from highlighting. It is a wildcard matching pattern when used with `case` (similar to `default` for `switch`es in C/C++), but `_` is far more often used in other contexts where highlighting the `_` might seem strange. For example, ignoring elements when unpacking tuples (`_, g, _, a = color`). This patch also updates the commented Python code for creating the list of keywords, for convenience. Before: {F13012878} After: {F13012880} Example from PEP-636 [1] Note: These soft keywords are only reserved under specific contexts. However, in order for the text editor to know when the keywords are used in the appropriate contexts, the text editor would need a full-blown Python grammar [2] parser. So, for now, these keywords are simply added in along with the other keywords in order to highlight them in the text editor. [0]: https://docs.python.org/3/reference/lexical_analysis.html#soft-keywords [1]: https://peps.python.org/pep-0636/#matching-specific-values [2]: https://docs.python.org/3/reference/grammar.html Ref D14707
Diffstat (limited to 'build_files/cmake/cmake_static_check_splint.py')
0 files changed, 0 insertions, 0 deletions