@jefuriiij/synthra 0.1.20 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -485,7 +485,7 @@ function extractKeywords(content, _ext) {
485
485
  }
486
486
 
487
487
  // src/scanner/extract.ts
488
- var RESOLVE_EXTS = [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".py", ".svelte", ".vue", ".dart"];
488
+ var RESOLVE_EXTS = [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".py", ".svelte", ".vue", ".dart", ".html", ".hubl"];
489
489
  var INDEX_FILES = ["index.ts", "index.tsx", "index.js", "index.jsx", "__init__.py"];
490
490
  function fileId(relPath) {
491
491
  return `file:${relPath}`;
@@ -889,6 +889,57 @@ async function parseGo(f, source) {
889
889
  );
890
890
  }
891
891
 
892
+ // src/scanner/parsers/hubl.ts
893
+ var MACRO_RE = /\{%-?\s*macro\s+([A-Za-z_]\w*)\s*\(([^)]*)\)/g;
894
+ var ENDMACRO_RE = /\{%-?\s*endmacro\b/g;
895
+ var BLOCK_RE = /\{%-?\s*block\s+([A-Za-z_]\w*)/g;
896
+ var ENDBLOCK_RE = /\{%-?\s*endblock\b/g;
897
+ var IMPORT_RE = /\{%-?\s*(?:include|extends|import|from)\s+["']([^"']+)["']/g;
898
+ function lineAt(source, index) {
899
+ return source.slice(0, index).split(/\r?\n/).length;
900
+ }
901
+ function endLineAfter(source, fromIndex, endRe, startLine) {
902
+ endRe.lastIndex = fromIndex;
903
+ const m = endRe.exec(source);
904
+ return m ? lineAt(source, m.index) : startLine;
905
+ }
906
+ function parseHubL(f, source) {
907
+ const symbols = [];
908
+ const imports = [];
909
+ for (const m of source.matchAll(MACRO_RE)) {
910
+ const name = m[1];
911
+ if (!name) continue;
912
+ const args = (m[2] ?? "").trim();
913
+ const start = m.index ?? 0;
914
+ const startLine = lineAt(source, start);
915
+ symbols.push({
916
+ name,
917
+ kind: "function",
918
+ startLine,
919
+ endLine: endLineAfter(source, start + m[0].length, ENDMACRO_RE, startLine),
920
+ signature: `macro ${name}(${args})`
921
+ });
922
+ }
923
+ for (const m of source.matchAll(BLOCK_RE)) {
924
+ const name = m[1];
925
+ if (!name) continue;
926
+ const start = m.index ?? 0;
927
+ const startLine = lineAt(source, start);
928
+ symbols.push({
929
+ name,
930
+ kind: "component",
931
+ startLine,
932
+ endLine: endLineAfter(source, start + m[0].length, ENDBLOCK_RE, startLine),
933
+ signature: `block ${name}`
934
+ });
935
+ }
936
+ for (const m of source.matchAll(IMPORT_RE)) {
937
+ const spec = m[1];
938
+ if (spec) imports.push(spec);
939
+ }
940
+ return { file: f, source, symbols, imports: Array.from(new Set(imports)), calls: [] };
941
+ }
942
+
892
943
  // src/scanner/parsers/java.ts
893
944
  var QUERY6 = `
894
945
  (class_declaration name: (identifier) @class.name) @class
@@ -1327,6 +1378,9 @@ async function parseFile(f) {
1327
1378
  return parseSvelte(f, source);
1328
1379
  case ".vue":
1329
1380
  return parseVue(f, source);
1381
+ case ".html":
1382
+ case ".hubl":
1383
+ return parseHubL(f, source);
1330
1384
  case ".go":
1331
1385
  return parseGo(f, source);
1332
1386
  case ".rs":