File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 149149 return "string" ;
150150 }
151151
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+ }
157159 }
158160
159161 switch ( last ( state . soyState ) ) {
Original file line number Diff line number Diff line change 111111 MT ( 'single-quote-strings' ,
112112 '[keyword {][string "foo"] [string \'bar\'][keyword }]' ,
113113 '' ) ;
114+
115+ MT ( 'literal-comments' ,
116+ '[keyword {literal}]/* comment */ // comment[keyword {/literal}]' ) ;
114117} ) ( ) ;
You can’t perform that action at this time.
0 commit comments