Home / Function/ build_locations() — svelte Function Reference

build_locations() — svelte Function Reference

Architecture documentation for the build_locations() function in index.js from the svelte codebase.

Function javascript Compiler Parser calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  120004de_c2c3_3931_173e_471c66b87359["build_locations()"]
  b14524b3_fb6c_95cc_463c_fff3e50c6bc6["index.js"]
  120004de_c2c3_3931_173e_471c66b87359 -->|defined in| b14524b3_fb6c_95cc_463c_fff3e50c6bc6
  bc77ac7b_055c_071d_a2e8_bdfe53d963db["transform_template()"]
  bc77ac7b_055c_071d_a2e8_bdfe53d963db -->|calls| 120004de_c2c3_3931_173e_471c66b87359
  8eb0634a_8224_3b8b_9823_55799e0165d5["array()"]
  120004de_c2c3_3931_173e_471c66b87359 -->|calls| 8eb0634a_8224_3b8b_9823_55799e0165d5
  36ba2c12_e83e_4a48_07b2_d8eda31d4eed["literal()"]
  120004de_c2c3_3931_173e_471c66b87359 -->|calls| 36ba2c12_e83e_4a48_07b2_d8eda31d4eed
  style 120004de_c2c3_3931_173e_471c66b87359 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/3-transform/client/transform-template/index.js lines 11–30

function build_locations(nodes) {
	const array = b.array([]);

	for (const node of nodes) {
		if (node.type !== 'element') continue;

		const { line, column } = locator(node.start);

		const expression = b.array([b.literal(line), b.literal(column)]);
		const children = build_locations(node.children);

		if (children.elements.length > 0) {
			expression.elements.push(children);
		}

		array.elements.push(expression);
	}

	return array;
}

Domain

Subdomains

Frequently Asked Questions

What does build_locations() do?
build_locations() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/3-transform/client/transform-template/index.js.
Where is build_locations() defined?
build_locations() is defined in packages/svelte/src/compiler/phases/3-transform/client/transform-template/index.js at line 11.
What does build_locations() call?
build_locations() calls 2 function(s): array, literal.
What calls build_locations()?
build_locations() is called by 1 function(s): transform_template.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free