Skip to content

Commit 5bd067d

Browse files
committed
feat: add MLIR and TableGen language support
Adds tree-sitter-based parsing for: - MLIR (.mlir) — 47/48 files parse clean on ascendnpu-ir - TableGen (.td) — 50/50 files parse clean WASM grammars are built from: - artagnon/tree-sitter-mlir (latest GitHub, ABI v15) - Flakebi/tree-sitter-tablegen (v0.0.1)
1 parent f34f606 commit 5bd067d

4 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/extraction/grammars.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ const WASM_GRAMMAR_FILES: Record<GrammarLanguage, string> = {
3939
r: 'tree-sitter-r.wasm',
4040
luau: 'tree-sitter-luau.wasm',
4141
objc: 'tree-sitter-objc.wasm',
42+
mlir: 'tree-sitter-mlir.wasm',
43+
tablegen: 'tree-sitter-tablegen.wasm',
4244
};
4345

4446
/**
@@ -115,6 +117,8 @@ export const EXTENSION_MAP: Record<string, Language> = {
115117
// shape as the `.yml` variants — the YAML/properties extractor emits one node
116118
// per leaf key, and the Spring resolver links `@Value("${k}")` references.
117119
'.properties': 'properties',
120+
'.mlir': 'mlir',
121+
'.td': 'tablegen',
118122
};
119123

120124
/**
@@ -428,6 +432,8 @@ export function getLanguageDisplayName(language: Language): string {
428432
xml: 'XML',
429433
properties: 'Java properties',
430434
unknown: 'Unknown',
435+
mlir: 'MLIR',
436+
tablegen: 'TableGen',
431437
};
432438
return names[language] || language;
433439
}
1.43 MB
Binary file not shown.
69.7 KB
Binary file not shown.

src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ export const LANGUAGES = [
9595
'twig',
9696
'xml',
9797
'properties',
98+
'mlir',
99+
'tablegen',
98100
'unknown',
99101
] as const;
100102

0 commit comments

Comments
 (0)