@@ -76,6 +76,25 @@ static bool ScannerIsCommentPrefix(ScannerRef self)
7676 return false ;
7777}
7878
79+ static bool ScannerIsMultilineCommentPrefix (ScannerRef self)
80+ {
81+ if (self -> input_buffer[self -> input_frontier] == ' /' &&
82+ self -> input_buffer[self -> input_frontier + 1 ] == ' *' )
83+ return true ;
84+
85+ return false ;
86+ }
87+
88+ // MW-2013-06-14: [[ ExternalsApiV5 ]] Add support for /* ... */ style multi-line comments.
89+ static bool ScannerIsMultilineCommentSuffix (ScannerRef self)
90+ {
91+ if (self -> input_buffer[self -> input_frontier] == ' *' &&
92+ self -> input_buffer[self -> input_frontier + 1 ] == ' /' )
93+ return true ;
94+
95+ return false ;
96+ }
97+
7998static bool ScannerIsIdentifierPrefix (ScannerRef self)
8099{
81100 char t_lookahead;
@@ -174,6 +193,26 @@ static void ScannerSkipComment(ScannerRef self)
174193 }
175194}
176195
196+ // MW-2013-06-14: [[ ExternalsApiV5 ]] Add support for /* ... */ style multi-line comments.
197+ static void ScannerSkipMultilineComment (ScannerRef self)
198+ {
199+ while (!ScannerIsEndPrefix (self))
200+ {
201+ if (ScannerIsNewlinePrefix (self))
202+ ScannerSkipNewline (self);
203+ else if (ScannerIsMultilineCommentSuffix (self))
204+ {
205+ self -> input_frontier += 2 ;
206+ self -> input_column += 2 ;
207+ break ;
208+ }
209+
210+ self -> input_frontier += 1 ;
211+ self -> input_column += 1 ;
212+ }
213+ }
214+
215+ // MW-2013-06-14: [[ ExternalsApiV5 ]] Add support for /* ... */ style multi-line comments.
177216static void ScannerSkipWhitespace (ScannerRef self)
178217{
179218 while (!ScannerIsEndPrefix (self))
@@ -187,6 +226,8 @@ static void ScannerSkipWhitespace(ScannerRef self)
187226 ScannerSkipNewline (self);
188227 else if (ScannerIsCommentPrefix (self))
189228 ScannerSkipComment (self);
229+ else if (ScannerIsMultilineCommentPrefix (self))
230+ ScannerSkipMultilineComment (self);
190231 else
191232 break ;
192233 }
0 commit comments