diff --git a/mk-appendix.py b/mk-appendix.py index 6949967..4a77d10 100644 --- a/mk-appendix.py +++ b/mk-appendix.py @@ -7,6 +7,7 @@ IN_APPENDIX = None CURRENT = "" + def print_syntax(val): vl = val.split("\n") last_empty = False @@ -24,24 +25,24 @@ def print_syntax(val): for l in sys.stdin: if not IN_APPENDIX: - m = re.match('%%% (.*)$', l) + m = re.match(r"%%% (.*)$", l) if m is not None: IN_APPENDIX = m.group(1) else: - m = re.match('%%(#+|!) (.*)$', l) + m = re.match(r"%%(#+|!) (.*)$", l) if m is not None: - if m.group(1) != '!': + if m.group(1) != "!": print("%s %s" % (m.group(1), m.group(2))) print_syntax(APPENDICES[m.group(2)]) del APPENDICES[m.group(2)] print() else: - print(l, end='') + print(l, end="") else: # Strip out everything marked as RESERVED if l.find("RESERVED") == -1: - print(l, end='') - m = re.match("\S", l) + print(l, end="") + m = re.match(r"\S", l) if m is None: CURRENT += l else: