File tree 1 file changed +7
-13
lines changed
1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change 16
16
token : function ( stream , state ) {
17
17
if ( stream . eatSpace ( ) ) return null ;
18
18
19
- if ( state . inComment ) {
20
- if ( stream . match ( / .* ?- \/ / ) ) {
21
- state . inComment = false ;
19
+ if ( state . commentLevel > 0 ) {
20
+ if ( stream . match ( / .* ?\/ - / ) ) {
21
+ state . commentLevel += 1 ;
22
+ } else if ( stream . match ( / .* ?- \/ / ) ) {
23
+ state . commentLevel -= 1 ;
22
24
} else {
23
25
stream . skipToEnd ( ) ;
24
26
}
25
27
return "comment" ;
26
28
}
27
29
28
-
29
- if ( state . inComment ) {
30
- if ( stream . match ( / - \/ / ) ) {
31
- state . inComment = false ;
32
- }
33
- return "comment" ;
34
- }
35
-
36
30
if ( stream . match ( / \/ - / ) ) {
37
- state . inComment = true ;
31
+ state . commentLevel += 1 ;
38
32
return "comment" ;
39
33
}
40
34
99
93
return null ;
100
94
} ,
101
95
startState : function ( ) {
102
- return { inDefinition : false , inComment : false } ;
96
+ return { inDefinition : false , commentLevel : 0 } ;
103
97
}
104
98
} ;
105
99
} ) ;
You can’t perform that action at this time.
0 commit comments