Checks if token is part of a block (e.g. `{...}`).

@param {number} i Token's index number
@return {number} Length of the block
774015
function checkBlock(i) {
  return i < tokensLength && tokens[i].block_end ?
      tokens[i].block_end - i + 1 : 0;
}
1362311
function checkDeclaration2(i) {
  const start = i;
  let l;

  if (i >= tokensLength) return 0;

  if (l = checkPropertyDelim(i)) i++;
  else return 0;

  if (l = checkProperty(i)) i += l;
  else return 0;

  if (l = checkValue(i)) return i + l - start;

  if (l = checkSC(i)) i += l;

  if (l = checkValue(i)) i += l;
  else return 0;

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

  if (i >= tokensLength || tokens[i++].value !== 'url' ||
      i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)
    return 0;

  return tokens[i].right - start + 1;
}
1063417
function checkBlockdecl(i) {
  let l;

  if (i >= tokensLength) return 0;

  if (l = checkBlockdecl7(i)) tokens[i].bd_type = 7;
  else if (l = checkBlockdecl5(i)) tokens[i].bd_type = 5;
  else if (l = checkBlockdecl6(i)) tokens[i].bd_type = 6;
  else if (l = checkBlockdecl1(i)) tokens[i].bd_type = 1;
  else if (l = checkBlockdecl2(i)) tokens[i].bd_type = 2;
  else if (l = checkBlockdecl3(i)) tokens[i].bd_type = 3;
  else if (l = checkBlockdecl4(i)) tokens[i].bd_type = 4;
  else return 0;

  return l;
}
404949
function isIndex(value, length) {
  var type = typeof value;
  length = length == null ? MAX_SAFE_INTEGER$1 : length;

  return !!length &&
    (type == 'number' ||
      (type != 'symbol' && reIsUint.test(value))) &&
        (value > -1 && value % 1 == 0 && value < length);
}
962597
function checkAttributeSelector1(i) {
  const start = i;

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

  let l;
  if (l = checkSC(i)) i += l;

  if (l = checkAttributeName(i)) i += l;
  else return 0;

  if (l = checkSC(i)) i += l;

  if (l = checkAttributeMatch(i)) i += l;
  else return 0;

  if (l = checkSC(i)) i += l;

  if (l = checkAttributeValue(i)) i += l;
  else return 0;

  if (l = checkSC(i)) i += l;

  if (l = checkAttributeFlags(i)) {
    i += l;
    if (l = checkSC(i)) i += l;
  }

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

  return i - start;
}
1251190
function checkPlaceholder(i) {
  const start = i;
  let l;

  if (i >= tokensLength) return 0;

  if (tokens[start].placeholder_l) return tokens[start].placeholder_l;

  // Skip `%`.
  if (tokens[i].type === TokenType.PercentSign) i++;
  else return 0;

  if (l = checkIdentOrInterpolation(i)) {
    i += l;
    tokens[start].placeholder_l = i - start;
  } else return 0;

  return i - start;
}
569071
function checkFunctionsList(i) {
  let d = 0; // Number of dots
  let l;

  if (i >= tokensLength) return 0;

  if (l = checkFunction(i)) i += l;
  else return 0;

  while (i < tokensLength && tokens[i].type === TokenType.FullStop) {
    d++;
    i++;
  }

  return d === 3 ? l + d : 0;
}
1274642
function checkInclude(i) {
  let l;

  if (i >= tokensLength) return 0;

  if (l = checkInclude1(i)) tokens[i].include_type = 1;
  else if (l = checkInclude2(i)) tokens[i].include_type = 2;

  return l;
}
48379
function checkProperty(i) {
  const start = i;
  let l;

  if (i >= tokensLength) return 0;

  if (l = checkVariable(i) || checkIdent(i)) i += l;
  else return 0;

  return i - start;
}
1132216
function checkAtrule(i) {
  let l;

  if (i >= tokensLength) return 0;

  // If token already has a record of being part of an @-rule,
  // return the @-rule's length:
  if (tokens[i].atrule_l !== undefined) return tokens[i].atrule_l;

  // If token is part of an @-rule, save the rule's type to token.
  if (l = checkKeyframesRule(i)) tokens[i].atrule_type = 4;
  // @-rule with ruleset:
  else if (l = checkAtruler(i)) tokens[i].atrule_type = 1;
  // Block @-rule:
  else if (l = checkAtruleb(i)) tokens[i].atrule_type = 2;
  // Single-line @-rule:
  else if (l = checkAtrules(i)) tokens[i].atrule_type = 3;
  else return 0;

  // If token is part of an @-rule, save the rule's length to token:
  tokens[i].atrule_l = l;

  return l;
}
520135
function checkDeclaration1(i) {
  const start = i;
  let l;

  if (i >= tokensLength) return 0;

  if (l = checkProperty(i)) i += l;
  else return 0;

  if (l = checkSC(i)) i += l;

  if (l = checkPropertyDelim(i)) i++;
  else return 0;

  if (l = checkValue(i)) return i + l - start;

  if (l = checkS(i)) i += l;

  if (l = checkValue(i)) i += l;
  else return 0;

  return i - start;
}
1349769
function checkProperty(i) {
  const start = i;
  let l;

  if (l = checkProperty1(i)) tokens[start].propertyType = 1;
  else if (l = checkProperty2(i)) tokens[start].propertyType = 2;
  else if (l = checkProperty3(i)) tokens[start].propertyType = 3;

  return l;
}
1204795
function checkCondition(i) {
  const start = i;
  let l;

  if (i >= tokensLength) return 0;

  if ((l = checkIdent(i)) && tokens[i].value === 'when') i += l;
  else return 0;

  while (i < tokensLength) {
    if (l = checkBlock(i)) {
      tokens[i].condition_child = 0;
      break;
    } else if (l = checkFunction(i)) tokens[i].condition_child = 1;
    else if (l = checkBrackets(i)) tokens[i].condition_child = 2;
    else if (l = checkParentheses(i)) tokens[i].condition_child = 3;
    else if (l = checkVariable(i)) tokens[i].condition_child = 4;
    else if (l = checkIdent(i)) tokens[i].condition_child = 5;
    else if (l = checkNumber(i)) tokens[i].condition_child = 6;
    else if (l = checkDelim(i)) tokens[i].condition_child = 7;
    else if (l = checkOperator(i)) tokens[i].condition_child = 8;
    else if (l = checkCombinator(i)) tokens[i].condition_child = 9;
    else if (l = checkSC(i)) tokens[i].condition_child = 10;
    else if (l = checkString(i)) tokens[i].condition_child = 11;
    else return 0;

    i += l;
  }

  return i - start;
}
30964
function at(a, i) {
  if (i >= 0) return a[i];
  return a[a.length + i];
}
653677
function(changeIndex) {
			var count = 0;
			var blockIndex = 0;
			
			if (0 <= changeIndex) {
				// iterate through blocks looking for the one that contains 
				// the change with the specified changeIndex
				while (blockIndex < this._root.children.length) {
					var numChangesInCurrentBlock = this._root.children[blockIndex].children.length;
					if (((count + numChangesInCurrentBlock) - 1) < changeIndex) {
						count += numChangesInCurrentBlock; //keep going
					} else {
						// found block, go to change in block
						var changeIndexInBlock = changeIndex - count;
						return this.gotoBlock(blockIndex, changeIndexInBlock);
					}
					blockIndex++;
				}
			}
		}
684358
function checkMixin(i) {
  let l;

  if (i >= tokensLength) return 0;

  if (l = checkMixin1(i)) tokens[i].mixin_type = 1;
  else if (l = checkMixin2(i)) tokens[i].mixin_type = 2;
  else return 0;

  return l;
}