Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(733)

Side by Side Diff: third_party/cython/src/Tools/cython-epydoc.py

Issue 385073004: Adding cython v0.20.2 in third-party. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reference cython dev list thread. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/cython/src/Tools/cython.st ('k') | third_party/cython/src/Tools/cython-mode.el » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #! /usr/bin/env python
2
3 # --------------------------------------------------------------------
4
5 import re
6 from epydoc import docstringparser as dsp
7
8 CYTHON_SIGNATURE_RE = re.compile(
9 # Class name (for builtin methods)
10 r'^\s*((?P<class>\w+)\.)?' +
11 # The function name
12 r'(?P<func>\w+)' +
13 # The parameters
14 r'\(((?P<self>(?:self|cls|mcs)),?)?(?P<params>.*)\)' +
15 # The return value (optional)
16 r'(\s*(->)\s*(?P<return>\w+(?:\s*\w+)))?' +
17 # The end marker
18 r'\s*(?:\n|$)')
19
20 parse_signature = dsp.parse_function_signature
21
22 def parse_function_signature(func_doc, doc_source,
23 docformat, parse_errors):
24 PYTHON_SIGNATURE_RE = dsp._SIGNATURE_RE
25 assert PYTHON_SIGNATURE_RE is not CYTHON_SIGNATURE_RE
26 try:
27 dsp._SIGNATURE_RE = CYTHON_SIGNATURE_RE
28 found = parse_signature(func_doc, doc_source,
29 docformat, parse_errors)
30 dsp._SIGNATURE_RE = PYTHON_SIGNATURE_RE
31 if not found:
32 found = parse_signature(func_doc, doc_source,
33 docformat, parse_errors)
34 return found
35 finally:
36 dsp._SIGNATURE_RE = PYTHON_SIGNATURE_RE
37
38 dsp.parse_function_signature = parse_function_signature
39
40 # --------------------------------------------------------------------
41
42 from epydoc.cli import cli
43 cli()
44
45 # --------------------------------------------------------------------
OLDNEW
« no previous file with comments | « third_party/cython/src/Tools/cython.st ('k') | third_party/cython/src/Tools/cython-mode.el » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698