Skip to content

Commit a9eed9d

Browse files
committed
Revert changes unrelated to compile
1 parent 5030922 commit a9eed9d

File tree

3 files changed

+39
-39
lines changed

3 files changed

+39
-39
lines changed

packages/svelte/src/compiler/index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,38 +107,38 @@ function handle_compile_error(error, filename, source) {
107107
/**
108108
* The parse function parses a component, returning only its abstract syntax tree.
109109
*
110-
* The `modernAst` option (`false` by default in Svelte 5) makes the parser return a modern AST instead of the legacy AST.
111-
* `modernAst` will become `true` by default in Svelte 6, and the option will be removed in Svelte 7.
110+
* The `modern` option (`false` by default in Svelte 5) makes the parser return a modern AST instead of the legacy AST.
111+
* `modern` will become `true` by default in Svelte 6, and the option will be removed in Svelte 7.
112112
*
113113
* https://svelte.dev/docs/svelte-compiler#svelte-parse
114114
* @overload
115115
* @param {string} source
116-
* @param {{ filename?: string; modernAst: true }} options
116+
* @param {{ filename?: string; modern: true }} options
117117
* @returns {import('#compiler').Root}
118118
*/
119119

120120
/**
121121
* The parse function parses a component, returning only its abstract syntax tree.
122122
*
123-
* The `modernAst` option (`false` by default in Svelte 5) makes the parser return a modern AST instead of the legacy AST.
124-
* `modernAst` will become `true` by default in Svelte 6, and the option will be removed in Svelte 7.
123+
* The `modern` option (`false` by default in Svelte 5) makes the parser return a modern AST instead of the legacy AST.
124+
* `modern` will become `true` by default in Svelte 6, and the option will be removed in Svelte 7.
125125
*
126126
* https://svelte.dev/docs/svelte-compiler#svelte-parse
127127
* @overload
128128
* @param {string} source
129-
* @param {{ filename?: string; modernAst?: false }} [options]
129+
* @param {{ filename?: string; modern?: false }} [options]
130130
* @returns {import('./types/legacy-nodes.js').LegacyRoot}
131131
*/
132132

133133
/**
134134
* The parse function parses a component, returning only its abstract syntax tree.
135135
*
136-
* The `modernAst` option (`false` by default in Svelte 5) makes the parser return a modern AST instead of the legacy AST.
137-
* `modernAst` will become `true` by default in Svelte 6, and the option will be removed in Svelte 7.
136+
* The `modern` option (`false` by default in Svelte 5) makes the parser return a modern AST instead of the legacy AST.
137+
* `modern` will become `true` by default in Svelte 6, and the option will be removed in Svelte 7.
138138
*
139139
* https://svelte.dev/docs/svelte-compiler#svelte-parse
140140
* @param {string} source
141-
* @param {{ filename?: string; modernAst?: boolean }} [options]
141+
* @param {{ filename?: string; modern?: boolean }} [options]
142142
* @returns {import('#compiler').Root | import('./types/legacy-nodes.js').LegacyRoot}
143143
*/
144144
export function parse(source, options = {}) {
@@ -154,7 +154,7 @@ export function parse(source, options = {}) {
154154
throw e;
155155
}
156156

157-
return to_public_ast(source, ast, options.modernAst);
157+
return to_public_ast(source, ast, options.modern);
158158
}
159159

160160
/**

packages/svelte/tests/parser-modern/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const { test, run } = suite<ParserTest>(async (config, cwd) => {
1515
const actual = JSON.parse(
1616
JSON.stringify(
1717
parse(input, {
18-
modernAst: true
18+
modern: true
1919
})
2020
)
2121
);

packages/svelte/types/index.d.ts

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -504,26 +504,26 @@ declare module 'svelte/compiler' {
504504
/**
505505
* The parse function parses a component, returning only its abstract syntax tree.
506506
*
507-
* The `modernAst` option (`false` by default in Svelte 5) makes the parser return a modern AST instead of the legacy AST.
508-
* `modernAst` will become `true` by default in Svelte 6, and the option will be removed in Svelte 7.
507+
* The `modern` option (`false` by default in Svelte 5) makes the parser return a modern AST instead of the legacy AST.
508+
* `modern` will become `true` by default in Svelte 6, and the option will be removed in Svelte 7.
509509
*
510510
* https://svelte.dev/docs/svelte-compiler#svelte-parse
511511
* */
512512
export function parse(source: string, options: {
513513
filename?: string;
514-
modernAst: true;
514+
modern: true;
515515
}): Root;
516516
/**
517517
* The parse function parses a component, returning only its abstract syntax tree.
518518
*
519-
* The `modernAst` option (`false` by default in Svelte 5) makes the parser return a modern AST instead of the legacy AST.
520-
* `modernAst` will become `true` by default in Svelte 6, and the option will be removed in Svelte 7.
519+
* The `modern` option (`false` by default in Svelte 5) makes the parser return a modern AST instead of the legacy AST.
520+
* `modern` will become `true` by default in Svelte 6, and the option will be removed in Svelte 7.
521521
*
522522
* https://svelte.dev/docs/svelte-compiler#svelte-parse
523523
* */
524524
export function parse(source: string, options?: {
525525
filename?: string | undefined;
526-
modernAst?: false | undefined;
526+
modern?: false | undefined;
527527
} | undefined): LegacyRoot;
528528
/**
529529
* @deprecated Replace this with `import { walk } from 'estree-walker'`
@@ -1051,15 +1051,15 @@ declare module 'svelte/compiler' {
10511051
filename?: string | undefined;
10521052
} | undefined): Promise<Processed>;
10531053
export class CompileError extends Error {
1054-
1054+
10551055
constructor(code: string, message: string, position: [number, number] | undefined);
1056-
1056+
10571057
filename: CompileError_1['filename'];
1058-
1058+
10591059
position: CompileError_1['position'];
1060-
1060+
10611061
start: CompileError_1['start'];
1062-
1062+
10631063
end: CompileError_1['end'];
10641064
code: string;
10651065
}
@@ -1078,9 +1078,9 @@ declare module 'svelte/compiler' {
10781078
code: string;
10791079
};
10801080
class Scope {
1081-
1081+
10821082
constructor(root: ScopeRoot, parent: Scope | null, porous: boolean);
1083-
1083+
10841084
root: ScopeRoot;
10851085
/**
10861086
* The immediate parent scope
@@ -1108,25 +1108,25 @@ declare module 'svelte/compiler' {
11081108
* which is usually an error. Block statements do not increase this value
11091109
*/
11101110
function_depth: number;
1111-
1111+
11121112
declare(node: import('estree').Identifier, kind: Binding['kind'], declaration_kind: DeclarationKind, initial?: null | import('estree').Expression | import('estree').FunctionDeclaration | import('estree').ClassDeclaration | import('estree').ImportDeclaration | EachBlock): Binding;
11131113
child(porous?: boolean): Scope;
1114-
1114+
11151115
generate(preferred_name: string): string;
1116-
1116+
11171117
get(name: string): Binding | null;
1118-
1118+
11191119
get_bindings(node: import('estree').VariableDeclarator | LetDirective): Binding[];
1120-
1120+
11211121
owner(name: string): Scope | null;
1122-
1122+
11231123
reference(node: import('estree').Identifier, path: SvelteNode[]): void;
11241124
#private;
11251125
}
11261126
class ScopeRoot {
1127-
1127+
11281128
conflicts: Set<string>;
1129-
1129+
11301130
unique(preferred_name: string): import("estree").Identifier;
11311131
}
11321132
namespace Css {
@@ -2032,21 +2032,21 @@ declare module 'svelte/motion' {
20322032

20332033
declare module 'svelte/reactivity' {
20342034
class ReactiveDate extends Date {
2035-
2035+
20362036
constructor(...values: any[]);
20372037
#private;
20382038
}
20392039
class ReactiveSet<T> extends Set<T> {
2040-
2040+
20412041
constructor(value?: Iterable<T> | null | undefined);
2042-
2042+
20432043
add(value: T): this;
20442044
#private;
20452045
}
20462046
class ReactiveMap<K, V> extends Map<K, V> {
2047-
2047+
20482048
constructor(value?: Iterable<readonly [K, V]> | null | undefined);
2049-
2049+
20502050
set(key: K, value: V): this;
20512051
#private;
20522052
}
@@ -2055,7 +2055,7 @@ declare module 'svelte/reactivity' {
20552055
#private;
20562056
}
20572057
class ReactiveURLSearchParams extends URLSearchParams {
2058-
2058+
20592059
[REPLACE](params: URLSearchParams): void;
20602060
#private;
20612061
}
@@ -2877,4 +2877,4 @@ declare function $inspect<T extends any[]>(
28772877
*/
28782878
declare function $host<El extends HTMLElement = HTMLElement>(): El;
28792879

2880-
//# sourceMappingURL=index.d.ts.map
2880+
//# sourceMappingURL=index.d.ts.map

0 commit comments

Comments
 (0)