Adds strformat code-gen for helping auto-generate readable strings for structs.

- Adds generator infra for absl::StrFormat for bind group structs and types.
- Uses absl::ParsedFormat to avoid multiple parsing for format strings.

Bug: dawn:549
Change-Id: Ida4ca65eb85c4474c492161c8ae34f53bd692a3c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81944
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
This commit is contained in:
Loko Kung
2022-03-19 00:21:48 +00:00
committed by Dawn LUCI CQ
parent 39c2029063
commit 4d8352542a
6 changed files with 115 additions and 55 deletions

View File

@@ -156,7 +156,8 @@ _FileOutput = namedtuple('FileOutput', ['name', 'content'])
def _do_renders(renders, template_dir):
loader = _PreprocessingLoader(template_dir)
env = jinja2.Environment(loader=loader,
env = jinja2.Environment(extensions=['jinja2.ext.do'],
loader=loader,
lstrip_blocks=True,
trim_blocks=True,
line_comment_prefix='//*')