lullaby/modules/render/sanitize_shader_source.cc
// Returns the start of a multiline comment within a line.
Returns the start of a multiline comment within a line.
Returns the start of a multiline comment within a line .
static const char* FindUnterminatedCommentInLine(const char* str, size_t len) {
  for (const char* ptr = str + len - 1; ptr > str; --ptr) {
    if (ptr[-1] == '*' && ptr[0] == '/') {
      return nullptr;
    }
    if (ptr[-1] == '/' && ptr[0] == '*') {
      return ptr - 1;
    }
  }
  return nullptr;
}
static const char * FindUnterminatedCommentInLine ( const char * str , size_t len ) { for ( const char * ptr = str + len - 1 ; ptr > str ; -- ptr ) { if ( ptr [ -1 ] == ' ' && ptr [ 0 ] == ' ' ) { return nullptr ; } if ( ptr [ -1 ] == ' ' && ptr [ 0 ] == ' ' ) { return ptr - 1 ; } } return nullptr ; }
Returns the start of a multiline comment within a line.
Returns the start of a multiline comment within a line .
// Search backwards.  If we find /*, return its location unless we've already // seen */.