Home / Function/ read_attribute_value() — svelte Function Reference

read_attribute_value() — svelte Function Reference

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

Function javascript Compiler Transformer calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  643a8559_c423_3568_92f9_91e141374c9c["read_attribute_value()"]
  251e2338_f8b8_69b4_b2e5_29ee7decbfa6["style.js"]
  643a8559_c423_3568_92f9_91e141374c9c -->|defined in| 251e2338_f8b8_69b4_b2e5_29ee7decbfa6
  fcabd261_14f2_2647_3794_39b7100eda95["read_selector()"]
  fcabd261_14f2_2647_3794_39b7100eda95 -->|calls| 643a8559_c423_3568_92f9_91e141374c9c
  9fcb1dc7_f1ea_4501_df05_9617e7c7d114["read_attribute_value()"]
  9fcb1dc7_f1ea_4501_df05_9617e7c7d114 -->|calls| 643a8559_c423_3568_92f9_91e141374c9c
  feea79ed_c6f7_4068_9c81_9734e5dcbfb7["unexpected_eof()"]
  643a8559_c423_3568_92f9_91e141374c9c -->|calls| feea79ed_c6f7_4068_9c81_9734e5dcbfb7
  style 643a8559_c423_3568_92f9_91e141374c9c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/1-parse/read/style.js lines 542–568

function read_attribute_value(parser) {
	let value = '';
	let escaped = false;
	const quote_mark = parser.eat('"') ? '"' : parser.eat("'") ? "'" : null;

	while (parser.index < parser.template.length) {
		const char = parser.template[parser.index];
		if (escaped) {
			value += '\\' + char;
			escaped = false;
		} else if (char === '\\') {
			escaped = true;
		} else if (quote_mark ? char === quote_mark : REGEX_CLOSING_BRACKET.test(char)) {
			if (quote_mark) {
				parser.eat(quote_mark, true);
			}

			return value.trim();
		} else {
			value += char;
		}

		parser.index++;
	}

	e.unexpected_eof(parser.template.length);
}

Domain

Subdomains

Frequently Asked Questions

What does read_attribute_value() do?
read_attribute_value() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/1-parse/read/style.js.
Where is read_attribute_value() defined?
read_attribute_value() is defined in packages/svelte/src/compiler/phases/1-parse/read/style.js at line 542.
What does read_attribute_value() call?
read_attribute_value() calls 1 function(s): unexpected_eof.
What calls read_attribute_value()?
read_attribute_value() is called by 2 function(s): read_attribute_value, read_selector.

Analyze Your Own Codebase

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

Try Supermodel Free