# AST for Svelte All AST nodes generated by the parser follow the [ESLint AST specifications]. The AST node in the script part is an AST generated by `espree` or the specified parser. See [ESTree] for the AST node of the script generated by `espree`. [eslint ast specifications]: https://eslint.org/docs/developer-guide/working-with-custom-parsers#the-ast-specification [estree]: https://github.com/estree/estree [identifier]: https://github.com/estree/estree/blob/master/es5.md#identifier [memberexpression]: https://github.com/estree/estree/blob/master/es5.md#memberexpression [literal]: https://github.com/estree/estree/blob/master/es5.md#literal [expression]: https://github.com/estree/estree/blob/master/es5.md#expressions [statement]: https://github.com/estree/estree/blob/master/es5.md#statements [variabledeclarator]: https://github.com/estree/estree/blob/master/es5.md#variabledeclarator [pattern]: https://github.com/estree/estree/blob/master/es5.md#patterns See details: [../src/ast/\*](../src/ast/) ## Common ### Node All nodes defined here inherit the `Node` specification. See [ESLint AST specifications] for detail. ```ts interface Node { type: string; loc: SourceLocation; range: [number, number]; } ``` ## Root ### SvelteProgram This is the root node of the AST. ```ts interface SvelteProgram extends Node { type: "Program"; body: (SvelteScriptElement | SvelteStyleElement | Child)[]; sourceType: "script" | "module"; comments: Comment[]; tokens: Token[]; } ``` ## Common Nodes ### SvelteName This is the name node. Similar to [Identifier], but the string given to name can be special. ```ts interface SvelteName extends Node { type: "SvelteName"; name: string; } ``` ## Root Elements ### SvelteScriptElement This is the `