src/sass/parse.js
function checkNumber(i) {
  if (i >= tokensLength) return 0;

  if (tokens[i].number_l) return tokens[i].number_l;

  // `10`:
  if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber &&
      (!tokens[i + 1] ||
      (tokens[i + 1] && tokens[i + 1].type !== TokenType.FullStop))) {
    tokens[i].number_l = 1;
    return 1;
  }

  // `10.`:
  if (i < tokensLength &&
      tokens[i].type === TokenType.DecimalNumber &&
      tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop &&
      (!tokens[i + 2] || (tokens[i + 2].type !== TokenType.DecimalNumber))) {
    tokens[i].number_l = 2;
    return 2;
  }

  // `.10`:
  if (i < tokensLength &&
      tokens[i].type === TokenType.FullStop &&
      tokens[i + 1].type === TokenType.DecimalNumber) {
    tokens[i].number_l = 2;
    return 2;
  }

  // `10.10`:
  if (i < tokensLength &&
      tokens[i].type === TokenType.DecimalNumber &&
      tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop &&
      tokens[i + 2] && tokens[i + 2].type === TokenType.DecimalNumber) {
    tokens[i].number_l = 3;
    return 3;
  }

  return 0;
}
function checkNumber(i) {
  if (i >= tokensLength) return 0;

  if (tokens[i].number_l) return tokens[i].number_l;

  // `10`:
  if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber &&
      (!tokens[i + 1] ||
      (tokens[i + 1] && tokens[i + 1].type !== TokenType.FullStop))) {
    tokens[i].number_l = 1;
    return 1;
  }

  // `10.`:
  if (i < tokensLength &&
      tokens[i].type === TokenType.DecimalNumber &&
      tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop &&
      (!tokens[i + 2] || (tokens[i + 2].type !== TokenType.DecimalNumber))) {
    tokens[i].number_l = 2;
    return 2;
  }

  // `.10`:
  if (i < tokensLength &&
      tokens[i].type === TokenType.FullStop &&
      tokens[i + 1].type === TokenType.DecimalNumber) {
    tokens[i].number_l = 2;
    return 2;
  }

  // `10.10`:
  if (i < tokensLength &&
      tokens[i].type === TokenType.DecimalNumber &&
      tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop &&
      tokens[i + 2] && tokens[i + 2].type === TokenType.DecimalNumber) {
    tokens[i].number_l = 3;
    return 3;
  }

  return 0;
}
function checkNumber ( i ) { if ( i >= tokensLength ) return 0 ; if ( tokens [ i ] . number_l ) return tokens [ i ] . number_l ; // `10`: if ( i < tokensLength && tokens [ i ] . type === TokenType . DecimalNumber && ( ! tokens [ i + 1 ] || ( tokens [ i + 1 ] && tokens [ i + 1 ] . type !== TokenType . FullStop ) ) ) { tokens [ i ] . number_l = 1 ; return 1 ; } // `10.`: if ( i < tokensLength && tokens [ i ] . type === TokenType . DecimalNumber && tokens [ i + 1 ] && tokens [ i + 1 ] . type === TokenType . FullStop && ( ! tokens [ i + 2 ] || ( tokens [ i + 2 ] . type !== TokenType . DecimalNumber ) ) ) { tokens [ i ] . number_l = 2 ; return 2 ; } // `.10`: if ( i < tokensLength && tokens [ i ] . type === TokenType . FullStop && tokens [ i + 1 ] . type === TokenType . DecimalNumber ) { tokens [ i ] . number_l = 2 ; return 2 ; } // `10.10`: if ( i < tokensLength && tokens [ i ] . type === TokenType . DecimalNumber && tokens [ i + 1 ] && tokens [ i + 1 ] . type === TokenType . FullStop && tokens [ i + 2 ] && tokens [ i + 2 ] . type === TokenType . DecimalNumber ) { tokens [ i ] . number_l = 3 ; return 3 ; } return 0 ; }
Check if token is part of a number
@param {number} i Token's index number
@return {number} Length of number
Check if token is part of a number