Changeset 993
- Timestamp:
- Jul 6, 2012 12:18:02 PM (11 years ago)
- Location:
- specdomain/trunk/src/specdomain
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
specdomain/trunk/src/specdomain/sphinxcontrib/specmacrofileparser.py
r992 r993 113 113 114 114 if self.state == 'global': 115 for thing in (self._is_def_macro, 115 for thing in ( 116 self._is_function_macro, 117 self._is_def_macro, 116 118 self._is_cdef_macro, 117 self._is_function_macro,118 119 self._is_lgc_variable, 119 120 self._is_one_line_extended_comment, … … 168 169 print "line_number, args: ", line_number, args 169 170 var, _ = args.split() 170 m[' text'] = var.rstrip(',')171 m['name'] = var.rstrip(',') 171 172 self.findings.append(dict(m)) 172 173 else: … … 175 176 # or leave these decisions for later, including some kind of analyzer 176 177 for var in args.split(): 177 m[' text'] = var.rstrip(',')178 m['name'] = var.rstrip(',') 178 179 self.findings.append(dict(m)) 179 180 # TODO: to what is this local? (remember the def it belongs to) … … 307 308 + r'\s*?' # optional blank space 308 309 + r'([a-zA-Z_][\w_]*)' # 1: function_name 310 + r'\s*?' # optional blank space 309 311 + r'\(' # opening parenthesis 310 312 + r'(.*?)' # 2: args (anything between the parentheses) … … 418 420 s.append( '.. spec:%s:: %s(%s)' % ( r['objtype'], r['name'], r['args']) ) 419 421 elif r['objtype'] in ('local', 'global', 'constant'): 422 del r['text'] 420 423 declarations.append(r) 421 424 422 s += _report_table('Variable Declarations', declarations) 423 s += _report_table('Macro Declarations', macros, ('start_line', 'name', 'line',)) 424 s += _report_table('Function Macro Declarations', functions) 425 s += report_table('Variable Declarations', declarations, ('start_line', 'objtype', 'name', 'line',)) 426 s += report_table('Macro Declarations', macros, ('start_line', 'name', 'line',)) 427 s += report_table('Function Macro Declarations', functions) 428 #s += report_table('Findings from .mac File', self.findings, ('start_line', 'objtype', 'line',)) 425 429 426 430 return '\n'.join(s) 427 431 428 432 429 def _report_table(self,title, itemlist, col_keys = ('start_line', 'line',)):433 def report_table(title, itemlist, col_keys = ('start_line', 'line',)): 430 434 """ 431 435 return the itemlist as a reST table … … 444 448 rows.append( tuple([str(d[key]).strip() for key in col_keys]) ) 445 449 last_line = d['start_line'] 446 return _make_table(title, col_keys, rows, '=')447 448 449 def _make_table(title, labels, rows, titlechar = '='):450 return make_table(title, col_keys, rows, '=') 451 452 453 def make_table(title, labels, rows, titlechar = '='): 450 454 """ 451 455 build a reST table (internal routine)
Note: See TracChangeset
for help on using the changeset viewer.