Home / Function/ read_at_rule() — svelte Function Reference

read_at_rule() — svelte Function Reference

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

Function javascript Compiler Analyzer calls 3 called by 2

Entity Profile

Dependency Diagram

graph TD
  415fd7b5_7697_362d_ade3_ce5751371f41["read_at_rule()"]
  c3e0c120_31a9_967c_7123_39ef0d74ea60["style.js"]
  415fd7b5_7697_362d_ade3_ce5751371f41 -->|defined in| c3e0c120_31a9_967c_7123_39ef0d74ea60
  c002d8fa_77f9_b9f2_ca2e_22fc262e0d09["read_body()"]
  c002d8fa_77f9_b9f2_ca2e_22fc262e0d09 -->|calls| 415fd7b5_7697_362d_ade3_ce5751371f41
  edff4d8f_bd22_039e_a63a_8e4b1bc47ec9["read_block_item()"]
  edff4d8f_bd22_039e_a63a_8e4b1bc47ec9 -->|calls| 415fd7b5_7697_362d_ade3_ce5751371f41
  28db6cfe_f394_e86a_af2e_8fc0a9157e14["read_identifier()"]
  415fd7b5_7697_362d_ade3_ce5751371f41 -->|calls| 28db6cfe_f394_e86a_af2e_8fc0a9157e14
  420684c6_6772_7487_805c_9f868588b2fe["read_value()"]
  415fd7b5_7697_362d_ade3_ce5751371f41 -->|calls| 420684c6_6772_7487_805c_9f868588b2fe
  5edbde78_a3c1_74bc_3465_c475d94644c4["read_block()"]
  415fd7b5_7697_362d_ade3_ce5751371f41 -->|calls| 5edbde78_a3c1_74bc_3465_c475d94644c4
  style 415fd7b5_7697_362d_ade3_ce5751371f41 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/1-parse/read/style.js lines 72–99

function read_at_rule(parser) {
	const start = parser.index;
	parser.eat('@', true);

	const name = read_identifier(parser);

	const prelude = read_value(parser);

	/** @type {AST.CSS.Block | null} */
	let block = null;

	if (parser.match('{')) {
		// e.g. `@media (...) {...}`
		block = read_block(parser);
	} else {
		// e.g. `@import '...'`
		parser.eat(';', true);
	}

	return {
		type: 'Atrule',
		start,
		end: parser.index,
		name,
		prelude,
		block
	};
}

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free