fix(elide): register an "mql" body-elision spec - #835
Merged
Merged
Conversation
compress_bodies returned MQL sources untouched: the specs map covered 16 languages but not mql, and the package is fail-soft (ErrUnsupportedLang -> original source, no error). The tree-sitter-mql5 grammar is a tree-sitter-cpp fork with identical function_definition / compound_statement shapes, so the spec mirrors cpp. Fixes #6
zzet
approved these changes
Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
internal/elide/elide.goregistered 16 languages in thespecsmap but notmql, and the package is fail-soft (ErrUnsupportedLang→ original source, no error):compress_bodiesreturned MQL code fully expanded. In 20k+ line files (Ducibus MQL codebase) that is exactly where compression matters most.Changes
The
tree-sitter-mql5grammar is a tree-sitter-cpp fork with identicalfunction_definition/compound_statementnode shapes, so the"mql"spec mirrors the"cpp"one (stubBrace,fieldFinder("body", "compound_statement")). One registry entry.Testing
TestCompress_MQL— MQL5 fixture: signatures + doc-comments intact, bodies elidedTestCompress_MQL4Legacy— pre-600 MQL4 (C subset,Order*API)TestCompress_MQL_SavesLines— compressed output is materially smaller than inputgo test -race ./...)Context: previously reviewed and merged in davalillo/gortex#10; complements the MQL extractor landed in #823.