mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
feat(python): allow comments before module docstring
Example: ```python #!/usr/bin/env/python # some comment before module docstring # Copyright (c) LICENSE foo bar """module docstring.""" ``` Python indeed recognizes it: ``` $ python -c 'import testfile; print(testfile.__doc__)' module docstring. ```
This commit is contained in:
parent
ce4adf11cf
commit
cb79d24461
1 changed files with 2 additions and 0 deletions
|
|
@ -199,6 +199,8 @@
|
||||||
|
|
||||||
; doc-strings
|
; doc-strings
|
||||||
(module
|
(module
|
||||||
|
.
|
||||||
|
(comment)*
|
||||||
.
|
.
|
||||||
(expression_statement
|
(expression_statement
|
||||||
(string) @string.documentation @spell))
|
(string) @string.documentation @spell))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue