Home / Function/ read_block() — svelte Function Reference

read_block() — svelte Function Reference

Architecture documentation for the read_block() function in style.js from the svelte codebase.

Function javascript Compiler Transformer calls 2 called by 2

Entity Profile

Dependency Diagram

graph TD
  880a32a4_ea32_dd22_0d38_a206a327356e["read_block()"]
  251e2338_f8b8_69b4_b2e5_29ee7decbfa6["style.js"]
  880a32a4_ea32_dd22_0d38_a206a327356e -->|defined in| 251e2338_f8b8_69b4_b2e5_29ee7decbfa6
  53e6c97d_9ffd_d8ad_0e88_afabeb05753a["read_at_rule()"]
  53e6c97d_9ffd_d8ad_0e88_afabeb05753a -->|calls| 880a32a4_ea32_dd22_0d38_a206a327356e
  1ea28e91_1a56_629a_4392_75e7a2e27b72["read_rule()"]
  1ea28e91_1a56_629a_4392_75e7a2e27b72 -->|calls| 880a32a4_ea32_dd22_0d38_a206a327356e
  ae0c2614_bb2e_88b4_b84e_1fd1d9fd582b["allow_comment_or_whitespace()"]
  880a32a4_ea32_dd22_0d38_a206a327356e -->|calls| ae0c2614_bb2e_88b4_b84e_1fd1d9fd582b
  b72c2083_31ae_feed_8216_d263cace4b10["read_block_item()"]
  880a32a4_ea32_dd22_0d38_a206a327356e -->|calls| b72c2083_31ae_feed_8216_d263cace4b10
  style 880a32a4_ea32_dd22_0d38_a206a327356e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/1-parse/read/style.js lines 410–436

function read_block(parser) {
	const start = parser.index;

	parser.eat('{', true);

	/** @type {Array<AST.CSS.Declaration | AST.CSS.Rule | AST.CSS.Atrule>} */
	const children = [];

	while (parser.index < parser.template.length) {
		allow_comment_or_whitespace(parser);

		if (parser.match('}')) {
			break;
		} else {
			children.push(read_block_item(parser));
		}
	}

	parser.eat('}', true);

	return {
		type: 'Block',
		start,
		end: parser.index,
		children
	};
}

Domain

Subdomains

Frequently Asked Questions

What does read_block() do?
read_block() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/1-parse/read/style.js.
Where is read_block() defined?
read_block() is defined in packages/svelte/src/compiler/phases/1-parse/read/style.js at line 410.
What does read_block() call?
read_block() calls 2 function(s): allow_comment_or_whitespace, read_block_item.
What calls read_block()?
read_block() is called by 2 function(s): read_at_rule, read_rule.

Analyze Your Own Codebase

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

Try Supermodel Free