File tree 3 files changed +40
-5
lines changed
tests/baselines/reference/JSDocParsing
3 files changed +40
-5
lines changed Original file line number Diff line number Diff line change @@ -7440,11 +7440,9 @@ namespace ts {
7440
7440
loop: while ( true ) {
7441
7441
switch ( tok ) {
7442
7442
case SyntaxKind . NewLineTrivia :
7443
- if ( state >= JSDocState . SawAsterisk ) {
7444
- state = JSDocState . BeginningOfLine ;
7445
- // don't use pushComment here because we want to keep the margin unchanged
7446
- comments . push ( scanner . getTokenText ( ) ) ;
7447
- }
7443
+ state = JSDocState . BeginningOfLine ;
7444
+ // don't use pushComment here because we want to keep the margin unchanged
7445
+ comments . push ( scanner . getTokenText ( ) ) ;
7448
7446
indent = 0 ;
7449
7447
break ;
7450
7448
case SyntaxKind . AtToken :
Original file line number Diff line number Diff line change @@ -320,6 +320,12 @@ namespace ts {
320
320
`/**
321
321
* @author John Doe <john.doe@example.com>
322
322
* @author John Doe <john.doe@example.com> unexpected comment
323
+ */` ) ;
324
+
325
+ parsesCorrectly ( "consecutive newline tokens" ,
326
+ `/**
327
+ * @example
328
+ * Some\n\n * text\r\n * with newlines.
323
329
*/` ) ;
324
330
} ) ;
325
331
} ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "kind" : " JSDocComment" ,
3
+ "pos" : 0 ,
4
+ "end" : 55 ,
5
+ "flags" : " JSDoc" ,
6
+ "modifierFlagsCache" : 0 ,
7
+ "transformFlags" : 0 ,
8
+ "tags" : {
9
+ "0" : {
10
+ "kind" : " JSDocTag" ,
11
+ "pos" : 7 ,
12
+ "end" : 19 ,
13
+ "modifierFlagsCache" : 0 ,
14
+ "transformFlags" : 0 ,
15
+ "tagName" : {
16
+ "kind" : " Identifier" ,
17
+ "pos" : 8 ,
18
+ "end" : 15 ,
19
+ "modifierFlagsCache" : 0 ,
20
+ "transformFlags" : 0 ,
21
+ "escapedText" : " example"
22
+ },
23
+ "comment" : " Some\n\n text\r\n with newlines."
24
+ },
25
+ "length" : 1 ,
26
+ "pos" : 7 ,
27
+ "end" : 19 ,
28
+ "hasTrailingComma" : false ,
29
+ "transformFlags" : 0
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments