Skip to content

Commit c676177

Browse files
committed
update comment
1 parent c0690bb commit c676177

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/parser/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ function parseAsSvelte(
259259
styleSelectorNodeLoc,
260260
svelteParseContext: {
261261
...svelteParseContext,
262+
// The compiler decides if runes mode is used after parsing.
262263
runes: svelteParseContext.runes ?? hasRunesSymbol(resultScript.ast),
263264
},
264265
});

src/parser/svelte-parse-context.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@ const runeSymbols: string[] = [
1919
/** The context for parsing. */
2020
export type SvelteParseContext = {
2121
/**
22-
* Whether to use Runes mode.
23-
* May be `true` if the user is using Svelte v5.
24-
* Resolved from `svelte.config.js` or `parserOptions`, but may be overridden by `<svelte:options>`.
22+
* Determines if the file is in Runes mode.
23+
*
24+
* - Svelte 3/4 does not support Runes mode.
25+
* - Checks if `runes` configuration exists in:
26+
* - `parserOptions`
27+
* - `svelte.config.js`
28+
* - `<svelte:options>` in the Svelte file.
29+
* - Returns `true` if the `runes` symbol is present in the Svelte file.
2530
*/
2631
runes?: boolean;
2732
/** The version of "svelte/compiler". */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy