This repository was archived by the owner on Sep 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 231
/
Copy pathangular_ast.dart
73 lines (71 loc) · 2.12 KB
/
angular_ast.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import 'src/ast.dart';
import 'src/exception_handler/exception_handler.dart';
import 'src/parser.dart';
export 'src/ast.dart'
show
AnnotationAst,
AttributeAst,
BananaAst,
CloseElementAst,
CommentAst,
ContainerAst,
ElementAst,
EmbeddedContentAst,
EmbeddedTemplateAst,
EventAst,
InterpolationAst,
LetBindingAst,
ParsedAnnotationAst,
ParsedAttributeAst,
ParsedBananaAst,
ParsedCloseElementAst,
ParsedDecoratorAst,
ParsedEmbeddedContentAst,
ParsedEventAst,
ParsedInterpolationAst,
ParsedElementAst,
ParsedLetBindingAst,
ParsedPropertyAst,
ParsedReferenceAst,
ParsedStarAst,
PropertyAst,
ReferenceAst,
StandaloneTemplateAst,
StarAst,
SyntheticTemplateAst,
TagOffsetInfo,
TemplateAst,
TextAst;
export 'src/exception_handler/exception_handler.dart'
show ExceptionHandler, RecoveringExceptionHandler, ThrowingExceptionHandler;
export 'src/exception_handler/exception_handler.dart';
export 'src/lexer.dart' show NgLexer;
export 'src/parser.dart' show NgParser;
export 'src/recovery_protocol/recovery_protocol.dart';
export 'src/token/tokens.dart' show NgToken, NgTokenType, NgAttributeValueToken;
export 'src/visitor.dart'
show
HumanizingTemplateAstVisitor,
IdentityTemplateAstVisitor,
MinimizeWhitespaceVisitor,
TemplateAstVisitor,
DesugarVisitor,
RecursiveTemplateAstVisitor;
/// Returns [template] parsed as an abstract syntax tree.
///
/// If [desugar] is set, parsing will transform `*directive` and `[(banana)]`
/// notations into their explicit forms using `<template>` and `[value]="..."
/// (valueChanged)="..."` respectively.
List<TemplateAst> parse(
String template, {
required String sourceUrl,
bool desugar = true,
ExceptionHandler exceptionHandler = const ThrowingExceptionHandler(),
}) {
return const NgParser().parse(
template,
sourceUrl: sourceUrl,
exceptionHandler: exceptionHandler,
desugar: desugar,
);
}