src/less/parse.js
function checkIdent(i) {
  const start = i;

  if (i >= tokensLength) return 0;

  if (tokens[i].type === TokenType.HyphenMinus) i++;

  if (tokens[i].type === TokenType.LowLine ||
      tokens[i].type === TokenType.Identifier) i++;
  else return 0;

  for (; i < tokensLength; i++) {
    if (tokens[i].type !== TokenType.HyphenMinus &&
        tokens[i].type !== TokenType.LowLine &&
        tokens[i].type !== TokenType.Identifier &&
        tokens[i].type !== TokenType.DecimalNumber) break;
  }

  tokens[start].ident_last = i - 1;

  return i - start;
}
function checkIdent(i) {
  const start = i;

  if (i >= tokensLength) return 0;

  if (tokens[i].type === TokenType.HyphenMinus) i++;

  if (tokens[i].type === TokenType.LowLine ||
      tokens[i].type === TokenType.Identifier) i++;
  else return 0;

  for (; i < tokensLength; i++) {
    if (tokens[i].type !== TokenType.HyphenMinus &&
        tokens[i].type !== TokenType.LowLine &&
        tokens[i].type !== TokenType.Identifier &&
        tokens[i].type !== TokenType.DecimalNumber) break;
  }

  tokens[start].ident_last = i - 1;

  return i - start;
}
function checkIdent ( i ) { const start = i ; if ( i >= tokensLength ) return 0 ; if ( tokens [ i ] . type === TokenType . HyphenMinus ) i ++ ; if ( tokens [ i ] . type === TokenType . LowLine || tokens [ i ] . type === TokenType . Identifier ) i ++ ; else return 0 ; for ( ; i < tokensLength ; i ++ ) { if ( tokens [ i ] . type !== TokenType . HyphenMinus && tokens [ i ] . type !== TokenType . LowLine && tokens [ i ] . type !== TokenType . Identifier && tokens [ i ] . type !== TokenType . DecimalNumber ) break ; } tokens [ start ] . ident_last = i - 1 ; return i - start ; }
Check if token is part of an identifier
@param {Number} i Token's index number
@returns {Number} Length of the identifier
Check if token is part of an identifier