From dfdce006edcfc6bda105eb81a1fd3c2d8749d1ee Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Thu, 15 Aug 2019 20:55:24 +0100 Subject: Formatting --- z80count/z80count.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/z80count/z80count.py b/z80count/z80count.py index 810985e..f1b28bf 100644 --- a/z80count/z80count.py +++ b/z80count/z80count.py @@ -45,9 +45,9 @@ def perror(message, *args, **kwargs): print(message % args, file=sys.stderr) -########################################################################## -# Program arguments # -########################################################################## +# +# Program arguments +# # NOTE: types as used in the schema are just the callables # responsibles for converting strings to python values (when the value @@ -202,9 +202,9 @@ def parse_command_line(defaults): return parser.parse_args() -########################################################################## -# z80count # -########################################################################## +# +# z80count +# def z80count(line, parser, @@ -254,7 +254,8 @@ def format_line(line, entry, total, total_cond, subt, update, column, comment += " case{%s}" % entry["case"] if len(line) == 1: - comment = comment_alignment(line[0], column, use_tabs, tab_width) + comment + comment = comment_alignment( + line[0], column, use_tabs, tab_width) + comment out = line[0] + comment if len(line) > 1: if update: @@ -323,6 +324,7 @@ def line_length(line, tab_width): class Parser(object): + """Simple parser based on a table of regexes.""" # [label:] OPERATOR [OPERANDS] [; comment] @@ -377,7 +379,8 @@ class Parser(object): @staticmethod def _init_entry(entry): - entry["cregex"] = re.compile(r"^\s*" + entry["regex"] + r"\s*(;.*)?$", re.I) + entry["cregex"] = re.compile( + r"^\s*" + entry["regex"] + r"\s*(;.*)?$", re.I) cycles = entry["cycles"] if "/" in cycles: c = cycles.split("/") -- cgit v1.2.3