Add default values to dawn.json for dawncpp.h
This adds almost all default values in descriptors that are present in
WebGPU to the C++ interface for Dawn.
This also fixes the indentation of dawncpp.h both by reindenting the
template, and making the indentation counting in generator_lib.py more
precise.
BUG=dawn:22
Change-Id: I9a852d26f78a3349f3d6eee7237407d1cf8ca426
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8680
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
diff --git a/generator/generator_lib.py b/generator/generator_lib.py
index fc355a9..01c8b91 100644
--- a/generator/generator_lib.py
+++ b/generator/generator_lib.py
@@ -103,8 +103,8 @@
source = self.preprocess(f.read())
return source, path, lambda: mtime == os.path.getmtime(path)
- blockstart = re.compile('{%-?\s*(if|for|block)[^}]*%}')
- blockend = re.compile('{%-?\s*end(if|for|block)[^}]*%}')
+ blockstart = re.compile('{%-?\s*(if|elif|else|for|block|macro)[^}]*%}')
+ blockend = re.compile('{%-?\s*(end(if|for|block|macro)|elif|else)[^}]*%}')
def preprocess(self, source):
lines = source.split('\n')