feat(python): highlight modules

This commit is contained in:
Omar Valdez 2024-10-28 23:45:33 -07:00 committed by Christian Clason
parent fb12c7f8a3
commit 8a74ac9aea
2 changed files with 21 additions and 2 deletions

View file

@ -310,7 +310,7 @@
(future_import_statement
"from" @keyword.import
"__future__" @constant.builtin)
"__future__" @module.builtin)
(import_from_statement
"from" @keyword.import)
@ -323,6 +323,25 @@
(wildcard_import
"*" @character.special)
(import_statement
name: (dotted_name
(identifier) @module))
(import_statement
name: (aliased_import
name: (dotted_name
(identifier) @module)
alias: (identifier) @module))
(import_from_statement
module_name: (dotted_name
(identifier) @module))
(import_from_statement
module_name: (relative_import
(dotted_name
(identifier) @module)))
[
"if"
"elif"

View file

@ -1,4 +1,4 @@
from __future__ import print_function
# ^ @keyword.import
# ^ @constant.builtin
# ^ @module.builtin
# ^ @keyword.import