File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 7272 return null ;
7373 }
7474 return false ;
75+ } ,
76+
77+ "/" : function ( stream , state ) {
78+ if ( ! stream . eat ( "*" ) ) return false
79+ state . tokenize = tokenNestedComment ( 1 )
80+ return state . tokenize ( stream , state )
7581 }
7682 }
7783 } ) ;
121127 return "variable" ;
122128 }
123129
130+ function tokenNestedComment ( depth ) {
131+ return function ( stream , state ) {
132+ var ch
133+ while ( ch = stream . next ( ) ) {
134+ if ( ch == "*" && stream . eat ( "/" ) ) {
135+ if ( depth == 1 ) {
136+ state . tokenize = null
137+ break
138+ } else {
139+ state . tokenize = tokenNestedComment ( depth - 1 )
140+ return state . tokenize ( stream , state )
141+ }
142+ } else if ( ch == "/" && stream . eat ( "*" ) ) {
143+ state . tokenize = tokenNestedComment ( depth + 1 )
144+ return state . tokenize ( stream , state )
145+ }
146+ }
147+ return "comment"
148+ }
149+ }
150+
124151 CodeMirror . registerHelper ( "hintWords" , "application/dart" , keywords . concat ( atoms ) . concat ( builtins ) ) ;
125152
126153 // This is needed to make loading through meta.js work.
You can’t perform that action at this time.
0 commit comments