@vigla/svelte 0.0.0-stage → 5.57.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action.d.ts +2 -0
- package/animate.d.ts +2 -0
- package/compiler/index.js +43266 -0
- package/compiler/index.js.map +1 -0
- package/compiler/package.json +3 -0
- package/compiler.d.ts +2 -0
- package/dist/compiler/diagnostics.d.ts +70 -0
- package/dist/compiler/diagnostics.d.ts.map +1 -0
- package/dist/compiler/diagnostics.js +166 -0
- package/dist/compiler/diagnostics.js.map +1 -0
- package/dist/compiler/index.d.ts +72 -0
- package/dist/compiler/index.d.ts.map +1 -0
- package/dist/compiler/index.js +178 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/compiler/options.d.ts +7 -0
- package/dist/compiler/options.d.ts.map +1 -0
- package/dist/compiler/options.js +126 -0
- package/dist/compiler/options.js.map +1 -0
- package/dist/compiler/preprocess/decode.d.ts +3 -0
- package/dist/compiler/preprocess/decode.d.ts.map +1 -0
- package/dist/compiler/preprocess/decode.js +60 -0
- package/dist/compiler/preprocess/decode.js.map +1 -0
- package/dist/compiler/preprocess/index.d.ts +27 -0
- package/dist/compiler/preprocess/index.d.ts.map +1 -0
- package/dist/compiler/preprocess/index.js +208 -0
- package/dist/compiler/preprocess/index.js.map +1 -0
- package/dist/compiler/preprocess/mapped.d.ts +25 -0
- package/dist/compiler/preprocess/mapped.d.ts.map +1 -0
- package/dist/compiler/preprocess/mapped.js +129 -0
- package/dist/compiler/preprocess/mapped.js.map +1 -0
- package/dist/compiler/proxy.d.ts +3 -0
- package/dist/compiler/proxy.d.ts.map +1 -0
- package/dist/compiler/proxy.js +133 -0
- package/dist/compiler/proxy.js.map +1 -0
- package/dist/entries/action.d.ts +2 -0
- package/dist/entries/action.d.ts.map +1 -0
- package/dist/entries/action.js +1 -0
- package/dist/entries/action.js.map +1 -0
- package/dist/entries/animate.d.ts +2 -0
- package/dist/entries/animate.d.ts.map +1 -0
- package/dist/entries/animate.js +2 -0
- package/dist/entries/animate.js.map +1 -0
- package/dist/entries/attachments.d.ts +2 -0
- package/dist/entries/attachments.d.ts.map +1 -0
- package/dist/entries/attachments.js +2 -0
- package/dist/entries/attachments.js.map +1 -0
- package/dist/entries/context.d.ts +15 -0
- package/dist/entries/context.d.ts.map +1 -0
- package/dist/entries/context.js +32 -0
- package/dist/entries/context.js.map +1 -0
- package/dist/entries/easing.d.ts +2 -0
- package/dist/entries/easing.d.ts.map +1 -0
- package/dist/entries/easing.js +2 -0
- package/dist/entries/easing.js.map +1 -0
- package/dist/entries/events.d.ts +2 -0
- package/dist/entries/events.d.ts.map +1 -0
- package/dist/entries/events.js +2 -0
- package/dist/entries/events.js.map +1 -0
- package/dist/entries/index-server.d.ts +4 -0
- package/dist/entries/index-server.d.ts.map +1 -0
- package/dist/entries/index-server.js +11 -0
- package/dist/entries/index-server.js.map +1 -0
- package/dist/entries/index.d.ts +10 -0
- package/dist/entries/index.d.ts.map +1 -0
- package/dist/entries/index.js +24 -0
- package/dist/entries/index.js.map +1 -0
- package/dist/entries/internal/client.d.ts +4 -0
- package/dist/entries/internal/client.d.ts.map +1 -0
- package/dist/entries/internal/client.js +9 -0
- package/dist/entries/internal/client.js.map +1 -0
- package/dist/entries/internal/disclose-version.d.ts +2 -0
- package/dist/entries/internal/disclose-version.d.ts.map +1 -0
- package/dist/entries/internal/disclose-version.js +4 -0
- package/dist/entries/internal/disclose-version.js.map +1 -0
- package/dist/entries/internal/index.d.ts +2 -0
- package/dist/entries/internal/index.d.ts.map +1 -0
- package/dist/entries/internal/index.js +2 -0
- package/dist/entries/internal/index.js.map +1 -0
- package/dist/entries/internal/server.d.ts +2 -0
- package/dist/entries/internal/server.d.ts.map +1 -0
- package/dist/entries/internal/server.js +7 -0
- package/dist/entries/internal/server.js.map +1 -0
- package/dist/entries/internal/tracing.d.ts +2 -0
- package/dist/entries/internal/tracing.d.ts.map +1 -0
- package/dist/entries/internal/tracing.js +2 -0
- package/dist/entries/internal/tracing.js.map +1 -0
- package/dist/entries/motion-server.d.ts +2 -0
- package/dist/entries/motion-server.d.ts.map +1 -0
- package/dist/entries/motion-server.js +2 -0
- package/dist/entries/motion-server.js.map +1 -0
- package/dist/entries/motion.d.ts +2 -0
- package/dist/entries/motion.d.ts.map +1 -0
- package/dist/entries/motion.js +2 -0
- package/dist/entries/motion.js.map +1 -0
- package/dist/entries/proxy.d.ts +6 -0
- package/dist/entries/proxy.d.ts.map +1 -0
- package/dist/entries/proxy.js +77 -0
- package/dist/entries/proxy.js.map +1 -0
- package/dist/entries/reactivity-server.d.ts +2 -0
- package/dist/entries/reactivity-server.d.ts.map +1 -0
- package/dist/entries/reactivity-server.js +2 -0
- package/dist/entries/reactivity-server.js.map +1 -0
- package/dist/entries/reactivity.d.ts +2 -0
- package/dist/entries/reactivity.d.ts.map +1 -0
- package/dist/entries/reactivity.js +2 -0
- package/dist/entries/reactivity.js.map +1 -0
- package/dist/entries/report.d.ts +3 -0
- package/dist/entries/report.d.ts.map +1 -0
- package/dist/entries/report.js +66 -0
- package/dist/entries/report.js.map +1 -0
- package/dist/entries/server.d.ts +8 -0
- package/dist/entries/server.d.ts.map +1 -0
- package/dist/entries/server.js +48 -0
- package/dist/entries/server.js.map +1 -0
- package/dist/entries/store-client.d.ts +12 -0
- package/dist/entries/store-client.d.ts.map +1 -0
- package/dist/entries/store-client.js +63 -0
- package/dist/entries/store-client.js.map +1 -0
- package/dist/entries/store-server.d.ts +12 -0
- package/dist/entries/store-server.d.ts.map +1 -0
- package/dist/entries/store-server.js +30 -0
- package/dist/entries/store-server.js.map +1 -0
- package/dist/entries/store.d.ts +25 -0
- package/dist/entries/store.d.ts.map +1 -0
- package/dist/entries/store.js +139 -0
- package/dist/entries/store.js.map +1 -0
- package/dist/entries/transition.d.ts +2 -0
- package/dist/entries/transition.d.ts.map +1 -0
- package/dist/entries/transition.js +2 -0
- package/dist/entries/transition.js.map +1 -0
- package/dist/entries/window-server.d.ts +2 -0
- package/dist/entries/window-server.d.ts.map +1 -0
- package/dist/entries/window-server.js +2 -0
- package/dist/entries/window-server.js.map +1 -0
- package/dist/entries/window.d.ts +2 -0
- package/dist/entries/window.d.ts.map +1 -0
- package/dist/entries/window.js +2 -0
- package/dist/entries/window.js.map +1 -0
- package/dist/front/ast.d.ts +290 -0
- package/dist/front/ast.d.ts.map +1 -0
- package/dist/front/ast.js +1 -0
- package/dist/front/ast.js.map +1 -0
- package/dist/front/diagnostics.d.ts +13 -0
- package/dist/front/diagnostics.d.ts.map +1 -0
- package/dist/front/diagnostics.js +38 -0
- package/dist/front/diagnostics.js.map +1 -0
- package/dist/front/ignores.d.ts +12 -0
- package/dist/front/ignores.d.ts.map +1 -0
- package/dist/front/ignores.js +75 -0
- package/dist/front/ignores.js.map +1 -0
- package/dist/front/index.d.ts +17 -0
- package/dist/front/index.d.ts.map +1 -0
- package/dist/front/index.js +65 -0
- package/dist/front/index.js.map +1 -0
- package/dist/front/legacy.d.ts +5 -0
- package/dist/front/legacy.d.ts.map +1 -0
- package/dist/front/legacy.js +408 -0
- package/dist/front/legacy.js.map +1 -0
- package/dist/front/locate.d.ts +4 -0
- package/dist/front/locate.d.ts.map +1 -0
- package/dist/front/locate.js +19 -0
- package/dist/front/locate.js.map +1 -0
- package/dist/front/lower.d.ts +39 -0
- package/dist/front/lower.d.ts.map +1 -0
- package/dist/front/lower.js +470 -0
- package/dist/front/lower.js.map +1 -0
- package/dist/front/parse/attribute.d.ts +12 -0
- package/dist/front/parse/attribute.d.ts.map +1 -0
- package/dist/front/parse/attribute.js +288 -0
- package/dist/front/parse/attribute.js.map +1 -0
- package/dist/front/parse/bracket.d.ts +3 -0
- package/dist/front/parse/bracket.d.ts.map +1 -0
- package/dist/front/parse/bracket.js +102 -0
- package/dist/front/parse/bracket.js.map +1 -0
- package/dist/front/parse/characters.d.ts +4 -0
- package/dist/front/parse/characters.d.ts.map +1 -0
- package/dist/front/parse/characters.js +6 -0
- package/dist/front/parse/characters.js.map +1 -0
- package/dist/front/parse/decode.d.ts +2 -0
- package/dist/front/parse/decode.d.ts.map +1 -0
- package/dist/front/parse/decode.js +89 -0
- package/dist/front/parse/decode.js.map +1 -0
- package/dist/front/parse/element.d.ts +3 -0
- package/dist/front/parse/element.d.ts.map +1 -0
- package/dist/front/parse/element.js +311 -0
- package/dist/front/parse/element.js.map +1 -0
- package/dist/front/parse/entities.d.ts +2 -0
- package/dist/front/parse/entities.d.ts.map +1 -0
- package/dist/front/parse/entities.js +2234 -0
- package/dist/front/parse/entities.js.map +1 -0
- package/dist/front/parse/expression.d.ts +5 -0
- package/dist/front/parse/expression.d.ts.map +1 -0
- package/dist/front/parse/expression.js +86 -0
- package/dist/front/parse/expression.js.map +1 -0
- package/dist/front/parse/html.d.ts +8 -0
- package/dist/front/parse/html.d.ts.map +1 -0
- package/dist/front/parse/html.js +146 -0
- package/dist/front/parse/html.js.map +1 -0
- package/dist/front/parse/identifier.d.ts +4 -0
- package/dist/front/parse/identifier.d.ts.map +1 -0
- package/dist/front/parse/identifier.js +24 -0
- package/dist/front/parse/identifier.js.map +1 -0
- package/dist/front/parse/index.d.ts +13 -0
- package/dist/front/parse/index.d.ts.map +1 -0
- package/dist/front/parse/index.js +74 -0
- package/dist/front/parse/index.js.map +1 -0
- package/dist/front/parse/js.d.ts +27 -0
- package/dist/front/parse/js.d.ts.map +1 -0
- package/dist/front/parse/js.js +241 -0
- package/dist/front/parse/js.js.map +1 -0
- package/dist/front/parse/options.d.ts +3 -0
- package/dist/front/parse/options.d.ts.map +1 -0
- package/dist/front/parse/options.js +198 -0
- package/dist/front/parse/options.js.map +1 -0
- package/dist/front/parse/parser.d.ts +50 -0
- package/dist/front/parse/parser.d.ts.map +1 -0
- package/dist/front/parse/parser.js +157 -0
- package/dist/front/parse/parser.js.map +1 -0
- package/dist/front/parse/pattern.d.ts +4 -0
- package/dist/front/parse/pattern.d.ts.map +1 -0
- package/dist/front/parse/pattern.js +53 -0
- package/dist/front/parse/pattern.js.map +1 -0
- package/dist/front/parse/script.d.ts +4 -0
- package/dist/front/parse/script.d.ts.map +1 -0
- package/dist/front/parse/script.js +60 -0
- package/dist/front/parse/script.js.map +1 -0
- package/dist/front/parse/style.d.ts +7 -0
- package/dist/front/parse/style.d.ts.map +1 -0
- package/dist/front/parse/style.js +397 -0
- package/dist/front/parse/style.js.map +1 -0
- package/dist/front/parse/tag.d.ts +3 -0
- package/dist/front/parse/tag.d.ts.map +1 -0
- package/dist/front/parse/tag.js +591 -0
- package/dist/front/parse/tag.js.map +1 -0
- package/dist/front/print/css.d.ts +5 -0
- package/dist/front/print/css.d.ts.map +1 -0
- package/dist/front/print/css.js +234 -0
- package/dist/front/print/css.js.map +1 -0
- package/dist/front/print/index.d.ts +18 -0
- package/dist/front/print/index.d.ts.map +1 -0
- package/dist/front/print/index.js +24 -0
- package/dist/front/print/index.js.map +1 -0
- package/dist/front/print/layout.d.ts +11 -0
- package/dist/front/print/layout.d.ts.map +1 -0
- package/dist/front/print/layout.js +73 -0
- package/dist/front/print/layout.js.map +1 -0
- package/dist/front/print/template.d.ts +5 -0
- package/dist/front/print/template.d.ts.map +1 -0
- package/dist/front/print/template.js +455 -0
- package/dist/front/print/template.js.map +1 -0
- package/dist/front/runes.d.ts +13 -0
- package/dist/front/runes.d.ts.map +1 -0
- package/dist/front/runes.js +253 -0
- package/dist/front/runes.js.map +1 -0
- package/dist/front/stores.d.ts +5 -0
- package/dist/front/stores.d.ts.map +1 -0
- package/dist/front/stores.js +84 -0
- package/dist/front/stores.js.map +1 -0
- package/dist/front/typescript.d.ts +2 -0
- package/dist/front/typescript.d.ts.map +1 -0
- package/dist/front/typescript.js +182 -0
- package/dist/front/typescript.js.map +1 -0
- package/dist/front/validate/anchors.d.ts +15 -0
- package/dist/front/validate/anchors.d.ts.map +1 -0
- package/dist/front/validate/anchors.js +43 -0
- package/dist/front/validate/anchors.js.map +1 -0
- package/dist/front/validate/index.d.ts +16 -0
- package/dist/front/validate/index.d.ts.map +1 -0
- package/dist/front/validate/index.js +139 -0
- package/dist/front/validate/index.js.map +1 -0
- package/dist/front/validate/legacy.d.ts +9 -0
- package/dist/front/validate/legacy.d.ts.map +1 -0
- package/dist/front/validate/legacy.js +102 -0
- package/dist/front/validate/legacy.js.map +1 -0
- package/dist/front/validate/report.d.ts +14 -0
- package/dist/front/validate/report.d.ts.map +1 -0
- package/dist/front/validate/report.js +29 -0
- package/dist/front/validate/report.js.map +1 -0
- package/dist/front/validate/template.d.ts +31 -0
- package/dist/front/validate/template.d.ts.map +1 -0
- package/dist/front/validate/template.js +507 -0
- package/dist/front/validate/template.js.map +1 -0
- package/dist/front/wording.d.ts +4 -0
- package/dist/front/wording.d.ts.map +1 -0
- package/dist/front/wording.js +110 -0
- package/dist/front/wording.js.map +1 -0
- package/dist/shared/format.d.ts +3 -0
- package/dist/shared/format.d.ts.map +1 -0
- package/dist/shared/format.js +7 -0
- package/dist/shared/format.js.map +1 -0
- package/easing.d.ts +2 -0
- package/elements.d.ts +1220 -0
- package/index.d.ts +2 -0
- package/motion.d.ts +2 -0
- package/package.json +128 -5
- package/src/compiler/diagnostics.ts +233 -0
- package/src/compiler/index.ts +292 -0
- package/src/compiler/options.ts +140 -0
- package/src/compiler/preprocess/decode.ts +85 -0
- package/src/compiler/preprocess/index.ts +299 -0
- package/src/compiler/preprocess/mapped.ts +146 -0
- package/src/compiler/proxy.ts +154 -0
- package/src/entries/action.ts +1 -0
- package/src/entries/animate.ts +1 -0
- package/src/entries/attachments.ts +1 -0
- package/src/entries/context.ts +50 -0
- package/src/entries/easing.ts +1 -0
- package/src/entries/events.ts +1 -0
- package/src/entries/index-server.ts +17 -0
- package/src/entries/index.ts +41 -0
- package/src/entries/internal/client.ts +15 -0
- package/src/entries/internal/disclose-version.ts +4 -0
- package/src/entries/internal/index.ts +3 -0
- package/src/entries/internal/server.ts +8 -0
- package/src/entries/internal/tracing.ts +1 -0
- package/src/entries/motion-server.ts +1 -0
- package/src/entries/motion.ts +1 -0
- package/src/entries/proxy.ts +86 -0
- package/src/entries/reactivity-server.ts +9 -0
- package/src/entries/reactivity.ts +9 -0
- package/src/entries/report.ts +81 -0
- package/src/entries/server.ts +76 -0
- package/src/entries/store-client.ts +80 -0
- package/src/entries/store-server.ts +44 -0
- package/src/entries/store.ts +201 -0
- package/src/entries/transition.ts +1 -0
- package/src/entries/window-server.ts +1 -0
- package/src/entries/window.ts +1 -0
- package/src/front/ast.ts +369 -0
- package/src/front/diagnostics.ts +53 -0
- package/src/front/ignores.ts +84 -0
- package/src/front/index.ts +86 -0
- package/src/front/legacy.ts +414 -0
- package/src/front/locate.ts +20 -0
- package/src/front/lower.ts +509 -0
- package/src/front/parse/attribute.ts +319 -0
- package/src/front/parse/bracket.ts +99 -0
- package/src/front/parse/characters.ts +19 -0
- package/src/front/parse/decode.ts +87 -0
- package/src/front/parse/element.ts +354 -0
- package/src/front/parse/entities.ts +2233 -0
- package/src/front/parse/expression.ts +85 -0
- package/src/front/parse/html.ts +158 -0
- package/src/front/parse/identifier.ts +29 -0
- package/src/front/parse/index.ts +88 -0
- package/src/front/parse/js.ts +284 -0
- package/src/front/parse/options.ts +194 -0
- package/src/front/parse/parser.ts +189 -0
- package/src/front/parse/pattern.ts +57 -0
- package/src/front/parse/script.ts +74 -0
- package/src/front/parse/style.ts +399 -0
- package/src/front/parse/tag.ts +601 -0
- package/src/front/print/css.ts +239 -0
- package/src/front/print/index.ts +40 -0
- package/src/front/print/layout.ts +87 -0
- package/src/front/print/template.ts +448 -0
- package/src/front/runes.ts +267 -0
- package/src/front/stores.ts +98 -0
- package/src/front/typescript.ts +178 -0
- package/src/front/validate/anchors.ts +54 -0
- package/src/front/validate/index.ts +174 -0
- package/src/front/validate/legacy.ts +119 -0
- package/src/front/validate/report.ts +38 -0
- package/src/front/validate/template.ts +549 -0
- package/src/front/wording.ts +112 -0
- package/src/shared/format.ts +8 -0
- package/store.d.ts +2 -0
- package/svelte-html.d.ts +53 -0
- package/transition.d.ts +2 -0
- package/types/compiler/interfaces.d.ts +2 -0
- package/types/compiler/preprocess.d.ts +2 -0
- package/types/index.d.ts +1453 -0
- package/README.md +0 -3
|
@@ -0,0 +1,601 @@
|
|
|
1
|
+
import type * as ES from 'estree';
|
|
2
|
+
import type * as AST from '../ast.ts';
|
|
3
|
+
import { fail } from '../diagnostics.ts';
|
|
4
|
+
import { findMatchingBracket, matchBracket } from './bracket.ts';
|
|
5
|
+
import { looseIdentifier, readExpression } from './expression.ts';
|
|
6
|
+
import { parseExpressionAt, parseStatementAt, type Node } from './js.ts';
|
|
7
|
+
import { fragment, type Parser } from './parser.ts';
|
|
8
|
+
import { readPattern } from './pattern.ts';
|
|
9
|
+
|
|
10
|
+
const closingBrace = /\s*}/y;
|
|
11
|
+
const supportedDeclaration = /(?:let|const)\b/y;
|
|
12
|
+
const unsupportedDeclaration = /(?:var|interface|enum)\b/y;
|
|
13
|
+
const maybeType = /type\b/y;
|
|
14
|
+
const pointy = { '<': '>' };
|
|
15
|
+
|
|
16
|
+
export function tag(parser: Parser): void {
|
|
17
|
+
const start = parser.index;
|
|
18
|
+
parser.index += 1;
|
|
19
|
+
parser.allowWhitespace();
|
|
20
|
+
|
|
21
|
+
if (parser.eat('#')) return open(parser);
|
|
22
|
+
if (parser.eat(':')) return next(parser);
|
|
23
|
+
if (parser.eat('@')) return special(parser);
|
|
24
|
+
if (parser.match('/') && !parser.match('/*') && !parser.match('//')) {
|
|
25
|
+
parser.eat('/');
|
|
26
|
+
return close(parser);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const declaration = readDeclaration(parser);
|
|
30
|
+
if (declaration !== null) {
|
|
31
|
+
parser.append({ type: 'DeclarationTag', start, end: parser.index, declaration });
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const expression = readExpression(parser);
|
|
36
|
+
parser.allowWhitespace();
|
|
37
|
+
parser.eat('}', true);
|
|
38
|
+
parser.append({ type: 'ExpressionTag', start, end: parser.index, expression });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function readDeclaration(parser: Parser): AST.DeclarationTag['declaration'] | null {
|
|
42
|
+
const start = parser.index;
|
|
43
|
+
const unsupported = parser.matchRegex(unsupportedDeclaration);
|
|
44
|
+
if (unsupported) {
|
|
45
|
+
fail('declaration_tag_invalid_type', { start, end: start + unsupported.length });
|
|
46
|
+
}
|
|
47
|
+
if (!parser.matchRegex(supportedDeclaration) && !parser.matchRegex(maybeType)) return null;
|
|
48
|
+
|
|
49
|
+
const commentCount = parser.comments.length;
|
|
50
|
+
let declaration: Node;
|
|
51
|
+
try {
|
|
52
|
+
declaration = parseStatementAt(parser, parser.template, start);
|
|
53
|
+
} catch (error) {
|
|
54
|
+
if (!parser.loose) throw error;
|
|
55
|
+
const end = findMatchingBracket(parser.template, start, '{');
|
|
56
|
+
if (end === undefined) throw error;
|
|
57
|
+
parser.index = end;
|
|
58
|
+
declaration = {
|
|
59
|
+
type: 'VariableDeclaration',
|
|
60
|
+
kind: parser.template.startsWith('const', start) ? 'const' : 'let',
|
|
61
|
+
declarations: [
|
|
62
|
+
{
|
|
63
|
+
type: 'VariableDeclarator',
|
|
64
|
+
id: { type: 'Identifier', name: '', start: parser.index, end: parser.index },
|
|
65
|
+
init: null,
|
|
66
|
+
start: parser.index,
|
|
67
|
+
end: parser.index
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
start,
|
|
71
|
+
end
|
|
72
|
+
} as unknown as Node;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (declaration.type !== 'VariableDeclaration') {
|
|
76
|
+
if (declaration.type === 'ExpressionStatement') {
|
|
77
|
+
parser.comments.length = commentCount;
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
fail('declaration_tag_invalid_type', {
|
|
81
|
+
start: declaration.start ?? start,
|
|
82
|
+
end: declaration.end ?? parser.index
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
const kind = (declaration as unknown as ES.VariableDeclaration).kind;
|
|
86
|
+
if (kind !== 'let' && kind !== 'const') fail('declaration_tag_invalid_type', declaration);
|
|
87
|
+
|
|
88
|
+
parser.index = declaration.end;
|
|
89
|
+
parser.allowWhitespace();
|
|
90
|
+
parser.eat('}', true);
|
|
91
|
+
return declaration as unknown as AST.DeclarationTag['declaration'];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function blockStart(parser: Parser, from: number): number {
|
|
95
|
+
let start = from;
|
|
96
|
+
while (parser.template[start] !== '{') start -= 1;
|
|
97
|
+
return start;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function open(parser: Parser): void {
|
|
101
|
+
const start = blockStart(parser, parser.index - 2);
|
|
102
|
+
|
|
103
|
+
if (parser.eat('if')) {
|
|
104
|
+
parser.requireWhitespace();
|
|
105
|
+
const block = parser.append<AST.IfBlock>({
|
|
106
|
+
type: 'IfBlock',
|
|
107
|
+
elseif: false,
|
|
108
|
+
start,
|
|
109
|
+
end: -1,
|
|
110
|
+
test: readExpression(parser),
|
|
111
|
+
consequent: fragment(),
|
|
112
|
+
alternate: null
|
|
113
|
+
});
|
|
114
|
+
parser.allowWhitespace();
|
|
115
|
+
parser.eat('}', true);
|
|
116
|
+
parser.push(block, block.consequent);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (parser.eat('each')) return each(parser, start);
|
|
121
|
+
|
|
122
|
+
if (parser.eat('await')) return awaitBlock(parser, start);
|
|
123
|
+
|
|
124
|
+
if (parser.eat('key')) {
|
|
125
|
+
parser.requireWhitespace();
|
|
126
|
+
const expression = readExpression(parser);
|
|
127
|
+
parser.allowWhitespace();
|
|
128
|
+
parser.eat('}', true);
|
|
129
|
+
const block = parser.append<AST.KeyBlock>({
|
|
130
|
+
type: 'KeyBlock',
|
|
131
|
+
start,
|
|
132
|
+
end: -1,
|
|
133
|
+
expression,
|
|
134
|
+
fragment: fragment()
|
|
135
|
+
});
|
|
136
|
+
parser.push(block, block.fragment);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (parser.eat('snippet')) return snippet(parser, start);
|
|
141
|
+
|
|
142
|
+
fail('expected_block_type', parser.index);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function each(parser: Parser, start: number): void {
|
|
146
|
+
parser.requireWhitespace();
|
|
147
|
+
const template = parser.template;
|
|
148
|
+
let end = parser.template.length;
|
|
149
|
+
let expression: AST.Expression | undefined;
|
|
150
|
+
|
|
151
|
+
while (expression === undefined) {
|
|
152
|
+
try {
|
|
153
|
+
expression = readExpression(parser, undefined, true);
|
|
154
|
+
} catch (error) {
|
|
155
|
+
const diagnostic = (error as { diagnostic?: { start: number } }).diagnostic;
|
|
156
|
+
if (diagnostic === undefined) throw error;
|
|
157
|
+
end = diagnostic.start - 2;
|
|
158
|
+
while (end > start && parser.template.slice(end, end + 2) !== 'as') end -= 1;
|
|
159
|
+
if (end <= start) {
|
|
160
|
+
if (parser.loose) {
|
|
161
|
+
expression = looseIdentifier(parser);
|
|
162
|
+
if (expression !== undefined) break;
|
|
163
|
+
}
|
|
164
|
+
throw error;
|
|
165
|
+
}
|
|
166
|
+
parser.template = template.slice(0, end);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
parser.template = template;
|
|
170
|
+
parser.allowWhitespace();
|
|
171
|
+
|
|
172
|
+
if (!parser.match('as')) {
|
|
173
|
+
if (expression.type === 'SequenceExpression') {
|
|
174
|
+
expression = expression.expressions[0] as AST.Expression;
|
|
175
|
+
}
|
|
176
|
+
const whole = expression;
|
|
177
|
+
let assertion: Node | null = null;
|
|
178
|
+
let to = whole.end as number;
|
|
179
|
+
expression = stripAssertion(whole as unknown as Node, whole.end as number, (node) => {
|
|
180
|
+
assertion = node;
|
|
181
|
+
to = (node.expression as Node).end;
|
|
182
|
+
}) as unknown as AST.Expression;
|
|
183
|
+
expression.end = to;
|
|
184
|
+
if (assertion !== null) {
|
|
185
|
+
let at = ((assertion as Node).typeAnnotation as Node).start - 2;
|
|
186
|
+
while (parser.template.slice(at, at + 2) !== 'as') at -= 1;
|
|
187
|
+
parser.index = at;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
let context: AST.Pattern | null = null;
|
|
192
|
+
let index: string | undefined;
|
|
193
|
+
let key: AST.Expression | undefined;
|
|
194
|
+
|
|
195
|
+
if (parser.eat('as')) {
|
|
196
|
+
parser.requireWhitespace();
|
|
197
|
+
context = readPattern(parser);
|
|
198
|
+
} else {
|
|
199
|
+
parser.index = expression.end as number;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
parser.allowWhitespace();
|
|
203
|
+
if (parser.eat(',')) {
|
|
204
|
+
parser.allowWhitespace();
|
|
205
|
+
index = parser.readIdentifier().name;
|
|
206
|
+
if (!index) fail('expected_identifier', parser.index);
|
|
207
|
+
parser.allowWhitespace();
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (parser.eat('(')) {
|
|
211
|
+
parser.allowWhitespace();
|
|
212
|
+
key = readExpression(parser, '(');
|
|
213
|
+
parser.allowWhitespace();
|
|
214
|
+
parser.eat(')', true);
|
|
215
|
+
parser.allowWhitespace();
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (!parser.eat('}', true, false)) {
|
|
219
|
+
if (parser.template.slice(parser.index - 4, parser.index) === ' as ') {
|
|
220
|
+
const previous = parser.index;
|
|
221
|
+
context = readPattern(parser);
|
|
222
|
+
parser.eat('}', true);
|
|
223
|
+
expression = {
|
|
224
|
+
type: 'Identifier',
|
|
225
|
+
name: '',
|
|
226
|
+
start: expression.start,
|
|
227
|
+
end: previous - 4
|
|
228
|
+
} as AST.Expression;
|
|
229
|
+
} else {
|
|
230
|
+
parser.eat('}', true);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const block = parser.append<AST.EachBlock>({
|
|
235
|
+
type: 'EachBlock',
|
|
236
|
+
start,
|
|
237
|
+
end: -1,
|
|
238
|
+
expression,
|
|
239
|
+
body: fragment(),
|
|
240
|
+
context,
|
|
241
|
+
index,
|
|
242
|
+
key
|
|
243
|
+
});
|
|
244
|
+
parser.push(block, block.body);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function stripAssertion(node: Node, end: number, found: (node: Node) => void): Node {
|
|
248
|
+
if (node.type === 'TSAsExpression' && node.end === end) {
|
|
249
|
+
found(node);
|
|
250
|
+
return node.expression as Node;
|
|
251
|
+
}
|
|
252
|
+
for (const key in node) {
|
|
253
|
+
if (key === 'type') continue;
|
|
254
|
+
const child = node[key];
|
|
255
|
+
if (child === null || typeof child !== 'object') continue;
|
|
256
|
+
if (Array.isArray(child)) {
|
|
257
|
+
for (let index = 0; index < child.length; index++) {
|
|
258
|
+
const item = child[index] as Node | null;
|
|
259
|
+
if (item !== null && typeof item === 'object' && item.type) {
|
|
260
|
+
child[index] = stripAssertion(item, end, found);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
} else if ((child as Node).type) {
|
|
264
|
+
node[key] = stripAssertion(child as Node, end, found);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return node;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function awaitBlock(parser: Parser, start: number): void {
|
|
271
|
+
parser.requireWhitespace();
|
|
272
|
+
const expression = readExpression(parser);
|
|
273
|
+
parser.allowWhitespace();
|
|
274
|
+
const block = parser.append<AST.AwaitBlock>({
|
|
275
|
+
type: 'AwaitBlock',
|
|
276
|
+
start,
|
|
277
|
+
end: -1,
|
|
278
|
+
expression,
|
|
279
|
+
value: null,
|
|
280
|
+
error: null,
|
|
281
|
+
pending: null,
|
|
282
|
+
then: null,
|
|
283
|
+
catch: null
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
if (parser.eat('then')) {
|
|
287
|
+
if (parser.matchRegex(closingBrace)) parser.allowWhitespace();
|
|
288
|
+
else {
|
|
289
|
+
parser.requireWhitespace();
|
|
290
|
+
block.value = readPattern(parser);
|
|
291
|
+
parser.allowWhitespace();
|
|
292
|
+
}
|
|
293
|
+
block.then = fragment();
|
|
294
|
+
parser.fragments.push(block.then);
|
|
295
|
+
} else if (parser.eat('catch')) {
|
|
296
|
+
if (parser.matchRegex(closingBrace)) parser.allowWhitespace();
|
|
297
|
+
else {
|
|
298
|
+
parser.requireWhitespace();
|
|
299
|
+
block.error = readPattern(parser);
|
|
300
|
+
parser.allowWhitespace();
|
|
301
|
+
}
|
|
302
|
+
block.catch = fragment();
|
|
303
|
+
parser.fragments.push(block.catch);
|
|
304
|
+
} else {
|
|
305
|
+
block.pending = fragment();
|
|
306
|
+
parser.fragments.push(block.pending);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if (!parser.eat('}', true, false)) {
|
|
310
|
+
if (parser.template.slice(parser.index - 6, parser.index) === ' then ') {
|
|
311
|
+
const previous = parser.index;
|
|
312
|
+
block.value = readPattern(parser);
|
|
313
|
+
parser.eat('}', true);
|
|
314
|
+
block.expression = {
|
|
315
|
+
type: 'Identifier',
|
|
316
|
+
name: '',
|
|
317
|
+
start: expression.start,
|
|
318
|
+
end: previous - 6
|
|
319
|
+
} as AST.Expression;
|
|
320
|
+
block.then = block.pending;
|
|
321
|
+
block.pending = null;
|
|
322
|
+
} else if (parser.template.slice(parser.index - 7, parser.index) === ' catch ') {
|
|
323
|
+
const previous = parser.index;
|
|
324
|
+
block.error = readPattern(parser);
|
|
325
|
+
parser.eat('}', true);
|
|
326
|
+
block.expression = {
|
|
327
|
+
type: 'Identifier',
|
|
328
|
+
name: '',
|
|
329
|
+
start: expression.start,
|
|
330
|
+
end: previous - 7
|
|
331
|
+
} as AST.Expression;
|
|
332
|
+
block.catch = block.pending;
|
|
333
|
+
block.pending = null;
|
|
334
|
+
} else {
|
|
335
|
+
parser.eat('}', true);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
parser.stack.push(block);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function snippet(parser: Parser, start: number): void {
|
|
342
|
+
parser.requireWhitespace();
|
|
343
|
+
const id = parser.readIdentifier();
|
|
344
|
+
if (id.name === '' && !parser.loose) fail('expected_identifier', parser.index);
|
|
345
|
+
parser.allowWhitespace();
|
|
346
|
+
const paramsStart = parser.index;
|
|
347
|
+
let typeParams: string | undefined;
|
|
348
|
+
if (parser.ts && parser.match('<')) {
|
|
349
|
+
const from = parser.index;
|
|
350
|
+
const to = matchBracket(parser.template, from, pointy);
|
|
351
|
+
typeParams = parser.template.slice(from + 1, to - 1);
|
|
352
|
+
parser.index = to;
|
|
353
|
+
}
|
|
354
|
+
parser.allowWhitespace();
|
|
355
|
+
const matched = parser.eat('(', true, false);
|
|
356
|
+
if (matched) {
|
|
357
|
+
let depth = 1;
|
|
358
|
+
while (parser.index < parser.template.length && (!parser.match(')') || depth !== 1)) {
|
|
359
|
+
if (parser.match('(')) depth++;
|
|
360
|
+
if (parser.match(')')) depth--;
|
|
361
|
+
parser.index += 1;
|
|
362
|
+
}
|
|
363
|
+
parser.eat(')', true);
|
|
364
|
+
}
|
|
365
|
+
const parameters = matched
|
|
366
|
+
? (parseExpressionAt(parser, `${parser.template.slice(0, parser.index)} => {}`, paramsStart)
|
|
367
|
+
.params as AST.Pattern[])
|
|
368
|
+
: [];
|
|
369
|
+
parser.allowWhitespace();
|
|
370
|
+
parser.eat('}', true);
|
|
371
|
+
const block = parser.append<AST.SnippetBlock>({
|
|
372
|
+
type: 'SnippetBlock',
|
|
373
|
+
start,
|
|
374
|
+
end: -1,
|
|
375
|
+
expression: id,
|
|
376
|
+
typeParams,
|
|
377
|
+
parameters,
|
|
378
|
+
body: fragment()
|
|
379
|
+
});
|
|
380
|
+
parser.push(block, block.body);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
function next(parser: Parser): void {
|
|
384
|
+
const start = parser.index - 1;
|
|
385
|
+
const block = parser.current();
|
|
386
|
+
|
|
387
|
+
if (block.type === 'IfBlock') {
|
|
388
|
+
if (!parser.eat('else')) fail('expected_token', start, { token: '{:else} or {:else if}' });
|
|
389
|
+
if (parser.eat('if')) fail('block_invalid_elseif', start);
|
|
390
|
+
if (block.alternate) fail('block_duplicate_clause', start, { name: '{:else}' });
|
|
391
|
+
parser.allowWhitespace();
|
|
392
|
+
parser.fragments.pop();
|
|
393
|
+
block.alternate = fragment();
|
|
394
|
+
parser.fragments.push(block.alternate);
|
|
395
|
+
if (parser.eat('if')) {
|
|
396
|
+
parser.requireWhitespace();
|
|
397
|
+
const test = readExpression(parser);
|
|
398
|
+
parser.allowWhitespace();
|
|
399
|
+
parser.eat('}', true);
|
|
400
|
+
const child = parser.append<AST.IfBlock>({
|
|
401
|
+
start: blockStart(parser, start - 1),
|
|
402
|
+
end: -1,
|
|
403
|
+
type: 'IfBlock',
|
|
404
|
+
elseif: true,
|
|
405
|
+
test,
|
|
406
|
+
consequent: fragment(),
|
|
407
|
+
alternate: null
|
|
408
|
+
});
|
|
409
|
+
parser.stack.push(child);
|
|
410
|
+
parser.fragments.pop();
|
|
411
|
+
parser.fragments.push(child.consequent);
|
|
412
|
+
} else {
|
|
413
|
+
parser.allowWhitespace();
|
|
414
|
+
parser.eat('}', true);
|
|
415
|
+
}
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
if (block.type === 'EachBlock') {
|
|
420
|
+
if (!parser.eat('else')) fail('expected_token', start, { token: '{:else}' });
|
|
421
|
+
if (block.fallback) fail('block_duplicate_clause', start, { name: '{:else}' });
|
|
422
|
+
parser.allowWhitespace();
|
|
423
|
+
parser.eat('}', true);
|
|
424
|
+
block.fallback = fragment();
|
|
425
|
+
parser.fragments.pop();
|
|
426
|
+
parser.fragments.push(block.fallback);
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
if (block.type === 'AwaitBlock') {
|
|
431
|
+
if (parser.eat('then')) {
|
|
432
|
+
if (block.then) fail('block_duplicate_clause', start, { name: '{:then}' });
|
|
433
|
+
if (!parser.eat('}')) {
|
|
434
|
+
parser.requireWhitespace();
|
|
435
|
+
block.value = readPattern(parser);
|
|
436
|
+
parser.allowWhitespace();
|
|
437
|
+
parser.eat('}', true);
|
|
438
|
+
}
|
|
439
|
+
block.then = fragment();
|
|
440
|
+
parser.fragments.pop();
|
|
441
|
+
parser.fragments.push(block.then);
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
if (parser.eat('catch')) {
|
|
445
|
+
if (block.catch) fail('block_duplicate_clause', start, { name: '{:catch}' });
|
|
446
|
+
if (!parser.eat('}')) {
|
|
447
|
+
parser.requireWhitespace();
|
|
448
|
+
block.error = readPattern(parser);
|
|
449
|
+
parser.allowWhitespace();
|
|
450
|
+
parser.eat('}', true);
|
|
451
|
+
}
|
|
452
|
+
block.catch = fragment();
|
|
453
|
+
parser.fragments.pop();
|
|
454
|
+
parser.fragments.push(block.catch);
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
fail('expected_token', start, { token: '{:then ...} or {:catch ...}' });
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
fail('block_invalid_continuation_placement', start);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
const closers: Readonly<Record<string, string>> = {
|
|
464
|
+
EachBlock: 'each',
|
|
465
|
+
KeyBlock: 'key',
|
|
466
|
+
AwaitBlock: 'await',
|
|
467
|
+
SnippetBlock: 'snippet'
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
function close(parser: Parser): void {
|
|
471
|
+
const start = parser.index - 1;
|
|
472
|
+
let block = parser.current();
|
|
473
|
+
|
|
474
|
+
if (block.type === 'IfBlock') {
|
|
475
|
+
if (!parser.eat('if', true, false)) {
|
|
476
|
+
block.end = start - 1;
|
|
477
|
+
parser.pop();
|
|
478
|
+
close(parser);
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
parser.allowWhitespace();
|
|
482
|
+
parser.eat('}', true);
|
|
483
|
+
while ((block as AST.IfBlock).elseif) {
|
|
484
|
+
block.end = parser.index;
|
|
485
|
+
parser.stack.pop();
|
|
486
|
+
block = parser.current();
|
|
487
|
+
}
|
|
488
|
+
block.end = parser.index;
|
|
489
|
+
parser.pop();
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
let matched: boolean;
|
|
494
|
+
const word = closers[block.type];
|
|
495
|
+
if (word !== undefined) {
|
|
496
|
+
matched = parser.eat(word, true, false);
|
|
497
|
+
} else if (block.type === 'RegularElement' && parser.loose) {
|
|
498
|
+
matched = false;
|
|
499
|
+
} else {
|
|
500
|
+
fail('block_unexpected_close', start);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
if (!matched) {
|
|
504
|
+
block.end = start - 1;
|
|
505
|
+
parser.pop();
|
|
506
|
+
close(parser);
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
parser.allowWhitespace();
|
|
510
|
+
parser.eat('}', true);
|
|
511
|
+
block.end = parser.index;
|
|
512
|
+
parser.pop();
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
function special(parser: Parser): void {
|
|
516
|
+
const start = blockStart(parser, parser.index);
|
|
517
|
+
|
|
518
|
+
if (parser.eat('html')) {
|
|
519
|
+
parser.requireWhitespace();
|
|
520
|
+
const expression = readExpression(parser);
|
|
521
|
+
parser.allowWhitespace();
|
|
522
|
+
parser.eat('}', true);
|
|
523
|
+
parser.append({ type: 'HtmlTag', start, end: parser.index, expression });
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
if (parser.eat('debug')) {
|
|
528
|
+
let identifiers: (ES.Identifier & AST.Located)[];
|
|
529
|
+
if (parser.read(closingBrace)) {
|
|
530
|
+
identifiers = [];
|
|
531
|
+
} else {
|
|
532
|
+
const expression = readExpression(parser);
|
|
533
|
+
identifiers = (
|
|
534
|
+
expression.type === 'SequenceExpression' ? expression.expressions : [expression]
|
|
535
|
+
) as (ES.Identifier & AST.Located)[];
|
|
536
|
+
for (const node of identifiers) {
|
|
537
|
+
if (node.type !== 'Identifier') fail('debug_tag_invalid_arguments', node.start);
|
|
538
|
+
}
|
|
539
|
+
parser.allowWhitespace();
|
|
540
|
+
parser.eat('}', true);
|
|
541
|
+
}
|
|
542
|
+
parser.append({ type: 'DebugTag', start, end: parser.index, identifiers });
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
if (parser.eat('const')) {
|
|
547
|
+
parser.requireWhitespace();
|
|
548
|
+
const id = readPattern(parser);
|
|
549
|
+
parser.allowWhitespace();
|
|
550
|
+
parser.eat('=', true);
|
|
551
|
+
parser.allowWhitespace();
|
|
552
|
+
const expressionStart = parser.index;
|
|
553
|
+
const init = readExpression(parser);
|
|
554
|
+
const declaratorEnd = parser.index;
|
|
555
|
+
if (
|
|
556
|
+
init.type === 'SequenceExpression' &&
|
|
557
|
+
!parser.template.substring(expressionStart, init.start as number).includes('(')
|
|
558
|
+
) {
|
|
559
|
+
fail('const_tag_invalid_expression', init);
|
|
560
|
+
}
|
|
561
|
+
parser.allowWhitespace();
|
|
562
|
+
parser.eat('}', true);
|
|
563
|
+
parser.append({
|
|
564
|
+
type: 'ConstTag',
|
|
565
|
+
start,
|
|
566
|
+
end: parser.index,
|
|
567
|
+
declaration: {
|
|
568
|
+
type: 'VariableDeclaration',
|
|
569
|
+
kind: 'const',
|
|
570
|
+
declarations: [
|
|
571
|
+
{ type: 'VariableDeclarator', id, init, start: id.start as number, end: declaratorEnd }
|
|
572
|
+
],
|
|
573
|
+
start: start + 2,
|
|
574
|
+
end: parser.index - 1
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
if (parser.eat('render')) {
|
|
581
|
+
parser.requireWhitespace();
|
|
582
|
+
const expression = readExpression(parser);
|
|
583
|
+
if (
|
|
584
|
+
expression.type !== 'CallExpression' &&
|
|
585
|
+
(expression.type !== 'ChainExpression' || expression.expression.type !== 'CallExpression')
|
|
586
|
+
) {
|
|
587
|
+
fail('render_tag_invalid_expression', expression);
|
|
588
|
+
}
|
|
589
|
+
parser.allowWhitespace();
|
|
590
|
+
parser.eat('}', true);
|
|
591
|
+
parser.append({
|
|
592
|
+
type: 'RenderTag',
|
|
593
|
+
start,
|
|
594
|
+
end: parser.index,
|
|
595
|
+
expression: expression as AST.RenderTag['expression']
|
|
596
|
+
});
|
|
597
|
+
return;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
fail('expected_tag', parser.index);
|
|
601
|
+
}
|