File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 149
149
return "string" ;
150
150
}
151
151
152
- if ( stream . match ( / ^ \/ \* / ) ) {
153
- state . soyState . push ( "comment" ) ;
154
- return "comment" ;
155
- } else if ( stream . match ( stream . sol ( ) || ( state . soyState . length && last ( state . soyState ) != "literal" ) ? / ^ \s * \/ \/ .* / : / ^ \s + \/ \/ .* / ) ) {
156
- return "comment" ;
152
+ if ( ! state . soyState . length || last ( state . soyState ) != "literal" ) {
153
+ if ( stream . match ( / ^ \/ \* / ) ) {
154
+ state . soyState . push ( "comment" ) ;
155
+ return "comment" ;
156
+ } else if ( stream . match ( stream . sol ( ) ? / ^ \s * \/ \/ .* / : / ^ \s + \/ \/ .* / ) ) {
157
+ return "comment" ;
158
+ }
157
159
}
158
160
159
161
switch ( last ( state . soyState ) ) {
Original file line number Diff line number Diff line change 111
111
MT ( 'single-quote-strings' ,
112
112
'[keyword {][string "foo"] [string \'bar\'][keyword }]' ,
113
113
'' ) ;
114
+
115
+ MT ( 'literal-comments' ,
116
+ '[keyword {literal}]/* comment */ // comment[keyword {/literal}]' ) ;
114
117
} ) ( ) ;
You can’t perform that action at this time.
0 commit comments