Changeset 987
- Timestamp:
- Jul 2, 2012 7:23:59 AM (11 years ago)
- Location:
- specdomain/trunk/src/specdomain/sphinxcontrib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
specdomain/trunk/src/specdomain/sphinxcontrib/specdomain.py
r970 r987 31 31 from sphinx.domains import Domain, ObjType, Index #@UnusedImport 32 32 from sphinx.util.compat import Directive #@UnusedImport 33 from sphinx.util.nodes import make_refnode, nested_parse_with_titles 33 from sphinx.util.nodes import make_refnode, nested_parse_with_titles #@UnusedImport 34 34 from sphinx.util.docfields import Field, TypedField 35 35 from sphinx.util.docstrings import prepare_docstring #@UnusedImport … … 42 42 #from sphinx.util.pycompat import base_exception, class_types 43 43 from specmacrofileparser import SpecMacrofileParser 44 from docutils.statemachine import ViewList 44 from docutils.statemachine import ViewList #@UnusedImport 45 45 46 46 … … 51 51 word_match = r'((?:[a-z_]\w*))' 52 52 cdef_match = r'(cdef)' 53 extended_comment_flag = r'\"\"\"'54 53 55 54 … … 65 64 spec_cdef_name_sig_re = re.compile(double_quote_string_match, 66 65 re.IGNORECASE|re.DOTALL) 67 68 69 spec_extended_comment_flag_sig_re = re.compile(extended_comment_flag,70 re.IGNORECASE|re.DOTALL)71 spec_extended_comment_start_sig_re = re.compile(r'^'72 + non_greedy_filler73 + extended_comment_flag,74 re.IGNORECASE|re.DOTALL)75 spec_extended_comment_block_sig_re = re.compile(r'^'76 + non_greedy_filler77 + extended_comment_flag78 + r'(' + non_greedy_filler + r')'79 + extended_comment_flag80 + non_greedy_filler81 + r'$',82 re.IGNORECASE|re.DOTALL|re.MULTILINE)83 66 84 67 … … 150 133 # This works for now. 151 134 self.add_line(u'', '<autodoc>') 135 self.add_line(u'.. index:: SPEC macro file; %s' % macrofile, '<autodoc>') 136 self.add_line(u'', '<autodoc>') 152 137 line = 'source code: :download:`%s <%s>`' % (macrofile, macrofile) 153 138 self.add_line(line, macrofile) 154 # TODO: Add each .mac file name to the Index155 139 156 140 self.add_line(u'', '<autodoc>') -
specdomain/trunk/src/specdomain/sphinxcontrib/specmacrofileparser.py
r986 r987 369 369 if not self.state == 'parsed': 370 370 raise RuntimeWarning, "state = %s, should be 'parsed'" % self.filename 371 return self._simple_ReST_renderer() 372 373 def _simple_ReST_renderer(self): 374 """create a simple ReStructured Text rendition of the findings""" 375 if not self.state == 'parsed': 376 raise RuntimeWarning, "state = %s, should be 'parsed'" % self.filename 371 377 372 s = []373 378 declarations = [] # variables and constants 374 379 macros = [] # def, cdef, and rdef macros 375 380 functions = [] # def and rdef function macros 381 title = 'Extended Comments' 382 s = ['', title, '='*len(title), ] 376 383 for r in self.findings: 377 384 if r['objtype'] == 'extended comment':
Note: See TracChangeset
for help on using the changeset viewer.