Skip to content

Commit

Permalink
Use whisker for python_capi
Browse files Browse the repository at this point in the history
Summary:
Whisker is a replacement for mustache and is largely backward compatible. It brings several quality of life improvements like... error checking.

You can read more about the details [in this post](https://fb.workplace.com/groups/498666380550247/permalink/2051389461944590/).

This diff moves `t_mstch_python_capi_generator` to use whisker instead of mstch.

This requires some changes to the templates to work around the bugs in mstch that have been previously worked around.

#buildall

Reviewed By: dtolnay

Differential Revision: D67563804

fbshipit-source-id: 3ec3405fdf4acb71e789c2bbcd957f8652e3eb08
  • Loading branch information
praihan authored and facebook-github-bot committed Jan 2, 2025
1 parent 829779f commit 6089bf3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions thrift/compiler/generate/t_mstch_python_capi_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,10 @@ class t_mstch_python_capi_generator : public t_mstch_generator {
public:
using t_mstch_generator::t_mstch_generator;

std::optional<whisker_options> use_whisker() const override {
return whisker_options();
}

std::string template_prefix() const override { return "python_capi"; }

void generate_program() override {
Expand Down

0 comments on commit 6089bf3

Please sign in to comment.