MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / findStringLit

Function findStringLit

src/extraction/languages/terraform.ts:392–402  ·  view source on GitHub ↗

First string_lit anywhere under an expression (source = "./modules/x").

(expr: SyntaxNode)

Source from the content-addressed store, hash-verified

390
391/** First string_lit anywhere under an expression (source = "./modules/x"). */
392function findStringLit(expr: SyntaxNode): SyntaxNode | null {
393 const queue: SyntaxNode[] = [expr];
394 while (queue.length) {
395 const n = queue.shift()!;
396 if (n.type === 'string_lit') return n;
397 for (const c of n.namedChildren) {
398 if (c) queue.push(c);
399 }
400 }
401 return null;
402}
403
404interface BlockDecl {
405 kind: 'class' | 'module' | 'variable' | 'namespace';

Callers 2

emitModuleWiringFunction · 0.85
readStringAttrFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected