eric6/Utilities/ClassBrowsers/protoclbr.py

changeset 7259
7c017076c12e
parent 7229
53054eb5b15a
child 7360
9190402e4505
equal deleted inserted replaced
7258:aff39db4dacc 7259:7c017076c12e
254 meth_return = _commentsub('', meth_return) 254 meth_return = _commentsub('', meth_return)
255 meth_return = _normalize(' ', meth_return) 255 meth_return = _normalize(' ', meth_return)
256 lineno = lineno + src.count('\n', last_lineno_pos, start) 256 lineno = lineno + src.count('\n', last_lineno_pos, start)
257 last_lineno_pos = start 257 last_lineno_pos = start
258 # close all interfaces/modules indented at least as much 258 # close all interfaces/modules indented at least as much
259 while classstack and \ 259 while classstack and classstack[-1][1] >= thisindent:
260 classstack[-1][1] >= thisindent:
261 if classstack[-1][0] is not None: 260 if classstack[-1][0] is not None:
262 # record the end line 261 # record the end line
263 classstack[-1][0].setEndLine(lineno - 1) 262 classstack[-1][0].setEndLine(lineno - 1)
264 del classstack[-1] 263 del classstack[-1]
265 if classstack: 264 if classstack:
294 elif m.start("Message") >= 0: 293 elif m.start("Message") >= 0:
295 # we found a message definition 294 # we found a message definition
296 thisindent = indent 295 thisindent = indent
297 indent += 1 296 indent += 1
298 # close all messages/services indented at least as much 297 # close all messages/services indented at least as much
299 while classstack and \ 298 while classstack and classstack[-1][1] >= thisindent:
300 classstack[-1][1] >= thisindent:
301 if classstack[-1][0] is not None: 299 if classstack[-1][0] is not None:
302 # record the end line 300 # record the end line
303 classstack[-1][0].setEndLine(lineno - 1) 301 classstack[-1][0].setEndLine(lineno - 1)
304 del classstack[-1] 302 del classstack[-1]
305 lineno = lineno + src.count('\n', last_lineno_pos, start) 303 lineno = lineno + src.count('\n', last_lineno_pos, start)
322 elif m.start("Enum") >= 0: 320 elif m.start("Enum") >= 0:
323 # we found a message definition 321 # we found a message definition
324 thisindent = indent 322 thisindent = indent
325 indent += 1 323 indent += 1
326 # close all messages/services indented at least as much 324 # close all messages/services indented at least as much
327 while classstack and \ 325 while classstack and classstack[-1][1] >= thisindent:
328 classstack[-1][1] >= thisindent:
329 if classstack[-1][0] is not None: 326 if classstack[-1][0] is not None:
330 # record the end line 327 # record the end line
331 classstack[-1][0].setEndLine(lineno - 1) 328 classstack[-1][0].setEndLine(lineno - 1)
332 del classstack[-1] 329 del classstack[-1]
333 lineno = lineno + src.count('\n', last_lineno_pos, start) 330 lineno = lineno + src.count('\n', last_lineno_pos, start)
350 elif m.start("Service") >= 0: 347 elif m.start("Service") >= 0:
351 # we found a message definition 348 # we found a message definition
352 thisindent = indent 349 thisindent = indent
353 indent += 1 350 indent += 1
354 # close all messages/services indented at least as much 351 # close all messages/services indented at least as much
355 while classstack and \ 352 while classstack and classstack[-1][1] >= thisindent:
356 classstack[-1][1] >= thisindent:
357 if classstack[-1][0] is not None: 353 if classstack[-1][0] is not None:
358 # record the end line 354 # record the end line
359 classstack[-1][0].setEndLine(lineno - 1) 355 classstack[-1][0].setEndLine(lineno - 1)
360 del classstack[-1] 356 del classstack[-1]
361 lineno = lineno + src.count('\n', last_lineno_pos, start) 357 lineno = lineno + src.count('\n', last_lineno_pos, start)

eric ide

mercurial