()
| 8 | ) |
| 9 | |
| 10 | func Python() *Language { |
| 11 | return &Language{ |
| 12 | Delims: regexp.MustCompile(`#|"""|'''`), |
| 13 | Parser: python.GetLanguage(), |
| 14 | Queries: []core.Scope{ |
| 15 | {Name: "", Expr: `(comment)+ @comment`, Type: ""}, |
| 16 | // Function docstrings |
| 17 | {Name: "", Expr: `((function_definition |
| 18 | body: (block . (expression_statement (string) @docstring))) |
| 19 | (#offset! @docstring 0 3 0 -3))`, Type: ""}, |
| 20 | // Class docstrings |
| 21 | {Name: "", Expr: `((class_definition |
| 22 | body: (block . (expression_statement (string) @docstring))) |
| 23 | (#offset! @docstring 0 3 0 -3))`, Type: ""}, |
| 24 | // Module docstrings |
| 25 | {Name: "", Expr: `((module . (expression_statement (string) @docstring)) |
| 26 | (#offset! @docstring 0 3 0 -3))`, Type: ""}, |
| 27 | }, |
| 28 | Padding: func(s string) int { |
| 29 | return computePadding(s, []string{"#", `"""`, "'''"}) |
| 30 | }, |
| 31 | } |
| 32 | } |
no test coverage detected
searching dependent graphs…