231 stats.inc('empty') |
231 stats.inc('empty') |
232 elif tok.type == INDENT: |
232 elif tok.type == INDENT: |
233 stats.indent(tok) |
233 stats.indent(tok) |
234 elif tok.type == DEDENT: |
234 elif tok.type == DEDENT: |
235 stats.dedent(tok) |
235 stats.dedent(tok) |
236 elif tok.type == KEYWORD: |
236 elif ( |
237 if tok.text in ("class", "def"): |
237 tok.type == KEYWORD and |
238 stats.push(parser.tokenlist[idx + 1].text, tok.row) |
238 tok.text in ("class", "def") |
|
239 ): |
|
240 stats.push(parser.tokenlist[idx + 1].text, tok.row) |
239 |
241 |
240 # collect overall statistics |
242 # collect overall statistics |
241 summarize(total, 'lines', parser.lines) |
243 summarize(total, 'lines', parser.lines) |
242 summarize(total, 'bytes', len(text)) |
244 summarize(total, 'bytes', len(text)) |
243 summarize(total, 'comments', stats.getCounter('TOTAL ', 'comments')) |
245 summarize(total, 'comments', stats.getCounter('TOTAL ', 'comments')) |