Replies: 1 comment
-
Perfect timing. I was just thinking about such an approach when recently trawling through and updating all the current grammar issues in prep for this most recent release. All of the issues which aren't for long lines, now have upstream issues, but I'm not expecting much traction on them so this would be a perfect compromise. I like it 👍 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Presently, our approach to improving an unmaintained grammar module has been to fork it or replace it with one that's actively-maintained. In most cases, this solution is a no-brainer. However, there are cases when this isn't desirable or even possible:
In situations like these, it might make more sense to patch the submodule3 using a locally-tracked
.patch
file (which could be applied prior to running the grammar-compiler). This has the advantage that it can be easily generated from a pull-request submitted to the original grammar (where the owner hasn't responded in quite some time), and the patch files can simply be deleted when or if they're finally merged upstream.Patches could be added to
vendor/patches/
with filenames of the formocaml.tmbundle.1.patch
(the name of the submodule entry undervendor/grammars
, followed by an incremental counter tracking the order in which multiple patches are to be applied). It could contain either a unified diff orgit-format-patch(1)
output.Example: ocaml.tmbundle.1.diff
Thoughts?
/cc @lildude, @Visne
Footnotes
Something I frequently worry about with my own grammars; I wasn't able to properly investigate SVG grammar broken Alhadis/language-etc#11 until I was at a workstation. ↩
For example, Oniguruma uses
\g<…>
for subroutine calls, while Perl/PCRE uses\k<…>
instead and treats\g<…≥
as a numbered backreference to a capturing group. ↩Full disclosure: this is essentially Homebrew's approach to patching formulae that
I'm shamelessly ripping offI've learned works well for submodules I CBFA maintaining a fork of. ↩Beta Was this translation helpful? Give feedback.
All reactions