Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py

changeset 6188
5a6ae3be31e6
parent 6170
2bcf6e5637e7
child 6645
ad476851d7e0
equal deleted inserted replaced
6187:2cc7e3629784 6188:5a6ae3be31e6
506 Private method to extract a docstring given a module source. 506 Private method to extract a docstring given a module source.
507 507
508 @param source source to parse (list of string) 508 @param source source to parse (list of string)
509 @return context of extracted docstring (DocStyleContext) 509 @return context of extracted docstring (DocStyleContext)
510 """ 510 """
511 for kind, value, (line, char), _, _ in tokenize.generate_tokens( 511 for kind, value, (line, _char), _, _ in tokenize.generate_tokens(
512 StringIO("".join(source)).readline): 512 StringIO("".join(source)).readline):
513 if kind in [tokenize.COMMENT, tokenize.NEWLINE, tokenize.NL]: 513 if kind in [tokenize.COMMENT, tokenize.NEWLINE, tokenize.NL]:
514 continue 514 continue
515 elif kind == tokenize.STRING: # first STRING should be docstring 515 elif kind == tokenize.STRING: # first STRING should be docstring
516 return DocStyleContext(value, line - 1, "docstring") 516 return DocStyleContext(value, line - 1, "docstring")

eric ide

mercurial