diff --git a/grammars/python.cson b/grammars/python.cson index ce38718..8163196 100644 --- a/grammars/python.cson +++ b/grammars/python.cson @@ -14,6 +14,33 @@ ] 'firstLineMatch': '^#!/.*\\bpython\\b' 'patterns': [ +# begin personal extensions + { + 'begin': '^\\s*(?=[uU]?[rR]?""")(.(?:.(?!"""))+.(?="""|\\Z))' + 'end': '(?<=""")' + 'captures': + '1': + 'name': 'summary.docstring.python' + 'patterns': [ + { + 'match': '(?:Args:|Arguments:)' + 'name': 'args.docstring.python' + } + { + 'match': '(?:Return:|Returns:)' + 'name': 'return.docstring.python' + } + ] + 'name': 'docstring.python' + } + { + 'match': '(\\s+)\\Z' + 'captures': + '1': + 'name': 'trailing.whitespace.python' + } +# end personal extensions + { 'begin': '(^[ \\t]+)?(?=#)' 'beginCaptures':