Skip to content

Commit 769980b

Browse files
authored
Merge pull request #41 from prettier/add-option-for-let
Add `@let` syntax support interface
2 parents 654e52b + 1720e1e commit 769980b

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

packages/angular-html-parser/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ interface Options {
7373
* tokenize angular control flow block syntax
7474
*/
7575
tokenizeAngularBlocks?: boolean,
76+
/**
77+
* tokenize angular let declaration syntax
78+
*/
79+
tokenizeAngularLetDeclaration?: boolean,
7680
}
7781
```
7882

packages/angular-html-parser/src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ export interface ParseOptions {
4545
* tokenize angular control flow block syntax
4646
*/
4747
tokenizeAngularBlocks?: boolean,
48+
/**
49+
* tokenize angular let declaration syntax
50+
*/
51+
tokenizeAngularLetDeclaration?: boolean,
4852
}
4953

5054
export function parse(
@@ -57,6 +61,7 @@ export function parse(
5761
isTagNameCaseSensitive = false,
5862
getTagContentType,
5963
tokenizeAngularBlocks = false,
64+
tokenizeAngularLetDeclaration = false,
6065
} = options;
6166
return getParser().parse(
6267
input,
@@ -67,6 +72,7 @@ export function parse(
6772
canSelfClose,
6873
allowHtmComponentClosingTags,
6974
tokenizeBlocks: tokenizeAngularBlocks,
75+
tokenizeLet: tokenizeAngularLetDeclaration,
7076
},
7177
isTagNameCaseSensitive,
7278
getTagContentType,

packages/compiler/src/ml_parser/ast.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ export class LetDeclaration implements BaseNode {
208208
visit(visitor: Visitor, context: any): any {
209209
return visitor.visitLetDeclaration(this, context);
210210
}
211+
212+
readonly type = 'letDeclaration';
213+
readonly startSourceSpan: null = null;
214+
readonly endSourceSpan: null = null;
211215
}
212216

213217
export interface Visitor {

0 commit comments

Comments
 (0)