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:
Jongwook Choi 2024-01-25 16:14:41 -05:00 committed by Christian Clason
parent ce4adf11cf
commit cb79d24461

View file

@ -199,6 +199,8 @@
; doc-strings
(module
.
(comment)*
.
(expression_statement
(string) @string.documentation @spell))