#!/usr/bin/python3 # # Copyright 2013-2023 The Khronos Group Inc. # # SPDX-License-Identifier: Apache-2.0 # Usage: realign [infile] > outfile # Used to realign XML tags in the Vulkan registry after it is operated on by # some other filter, since whitespace inside a tag is not part of the # internal representation. import copy, sys, string, re def realignXML(fp): patterns = [ [ r'(^ *\ 1): realignXML(open(sys.argv[1], 'r', encoding='utf-8')) else: realignXML(sys.stdin)