You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(engine): MATLAB extractor with .m disambiguation from ObjC
MATLAB shares .m with Objective-C. detectLanguage() now sniffs the first
4KB of file content: ObjC markers (@interface/@implementation/#import/
#include) → objc; otherwise MATLAB. EXTENSION_MAP still maps .m → objc
as the default; the heuristic only overrides when no ObjC markers exist.
Vendored grammar: acristoffers/tree-sitter-matlab (built locally via
tree-sitter-cli; upstream ships only Python wheels).
Copy file name to clipboardExpand all lines: engine/PATCHES.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,3 +36,15 @@ Perl — each documented as a numbered entry below when it lands.
36
36
-`const_statement` wraps an inner `assignment` node
37
37
-`macro_definition` has the same structure as `function_definition`
38
38
- Call edges work via the standard `call_expression` in `callTypes`; `visitFunctionBody` recursively finds them
39
+
40
+
### MATLAB (added 2026-05-30)
41
+
- WASM grammar: `engine/src/extraction/wasm/tree-sitter-matlab.wasm` built locally from acristoffers/tree-sitter-matlab (upstream ships only Python wheels)
42
+
- Extension map: `.m` is shared with Objective-C; disambiguated by `detectLanguage(filePath, content)` content heuristic that checks for ObjC markers (`@interface`, `@implementation`, `#import`, `#include`) in the first 4 KB. `EXTENSION_MAP` still maps `.m` → `objc` as the default; the heuristic overrides to `matlab` only when no ObjC markers are found.
-`function_definition`: field `'name'` → function identifier; `function_output` optional named child for return values; `function_arguments` named child for params; `block` named child for body
47
+
- Three function forms: `function greet()`, `function result = hello(name)`, `function [a,b] = swap(x,y)` — all produce `function_definition` nodes with the same structure
48
+
-`function_call`: field `'name'` → callee identifier; used for call edges via `callTypes: ['function_call']`
0 commit comments