mix gumbo.patches (gumbo v0.3.0)

Copy Markdown View Source

Regenerates the vendored-parser patches from their definitions.

mix gumbo.patches            # rewrite the patches whose definitions changed
mix gumbo.patches --check    # assert the committed patches are what the definitions produce

Every .patch under c_src/patches/gumbo-parser/ that has a .exs of the same name is generated: the pinned source, the earlier patches applied with git apply, the definition's substitutions in order — each asserting how many occurrences it must find — and the diff of the pin against the result, preceded by the definition's header. Gumbo.Patches holds the machinery, including why the diff is a port of Python's difflib rather than any equivalent one.

--check is what make check-generators runs: it writes nothing and fails when a regenerated patch differs by even one byte from the committed file. That is the net the Python tooling never had, and it is what makes "the tool still produces what the repository contains" a property someone can check instead of a belief.