Repository navigation
fix(astquery): wire "mql" into the language resolver and parse gate - #836
Merged
Merged
Conversation
DefaultLanguageResolver had no "mql" case, so raw-pattern search_ast runs over MQL targets compiled no query and returned 0 matches with no error (the plan skips nil-resolver languages silently). The MQL grammar is a tree-sitter-cpp fork, so cpp-shaped patterns match as-is once the binding is wired. Also teach parseGateLanguage about .mq4/.mq5/.mqh: the pre-write parse gate previously had no opinion on MQL edits and skipped silently. Fixes #5
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
DefaultLanguageResolver(internal/astquery/languages.go) had nocase "mql", sosearch_astwith raw patterns over MQL targets compiled no query and returned 0 matches without error (the plan silently skips languages with anilresolver,engine.go). The MQL grammar is a tree-sitter-cpp fork, so cpp patterns (call_expression,function_definition, …) match as-is once the binding is wired.Changes
Additionally,
parseGateLanguage(internal/mcp/parse_gate.go) did not know.mq4/.mq5/.mqh: theedit_file/write_fileparse gate had no opinion on MQL edits and skipped syntax validation (fail-open). Same fix.Testing
TestDefaultLanguageResolver_MQL— the resolver no longer returns nilTestRawPattern_MQL_CallExpression/_AnyCallExpression/_FunctionDefinition— real raw patterns over an MQL5 fixture (ObjectSet-style calls)TestParseGateLanguageextended (.mq5/.mq4/.mqh→mql) and clean/broken MQL cases inTestParseErrorCountGogo test -race ./...)ObjectSetinsyr_mq4.mqh)Context: previously reviewed and merged in davalillo/gortex#11; complements the MQL extractor landed in #823.