tools/spec: add basic type hinting for write_foo functions

This commit is contained in:
Danny Robson 2019-01-05 12:00:56 +11:00
parent 44edf5d00e
commit 7a5742bb57

View File

@ -716,7 +716,7 @@ def parse_extensions(reg:registry, root):
############################################################################### ###############################################################################
def write_header(path:str, q): def write_header(path:str, q:List[type]):
with open(path, 'w') as dst: with open(path, 'w') as dst:
dst.write("#pragma once\n") dst.write("#pragma once\n")
@ -768,7 +768,7 @@ def write_header(path:str, q):
##----------------------------------------------------------------------------- ##-----------------------------------------------------------------------------
def write_icd(path:str, q): def write_icd(path:str, q:List[type]):
with open(path, 'w') as icd: with open(path, 'w') as icd:
commands = [i for i in q if isinstance(i, command)] commands = [i for i in q if isinstance(i, command)]
instance_commands = [i for i in commands if i.is_instance(reg)] instance_commands = [i for i in commands if i.is_instance(reg)]
@ -815,7 +815,7 @@ def write_icd(path:str, q):
##----------------------------------------------------------------------------- ##-----------------------------------------------------------------------------
def write_dispatch(path:str, q): def write_dispatch(path:str, q:List[type]):
with open(path, 'w') as dispatch: with open(path, 'w') as dispatch:
dispatch.write(""" dispatch.write("""
#include "../vk.hpp" #include "../vk.hpp"