def getEndIndexConvertEquationValue(bracketEndIndex, evaluatorIndex, evaluators):
 evaluator = evaluators[evaluatorIndex]
 if (evaluator.__class__ != EvaluatorValue):
  return bracketEndIndex
 if (not evaluator.word.startswith('equation.')):
  return bracketEndIndex
 if (evaluators[(evaluatorIndex + 1)].word != ':'):
  return bracketEndIndex
 valueBeginIndex = (evaluatorIndex + 2)
 equationValueString = ''
 for valueEvaluatorIndex in xrange(valueBeginIndex, len(evaluators)):
  valueEvaluator = evaluators[valueEvaluatorIndex]
  if ((valueEvaluator.word == ',') or (valueEvaluator.word == '}')):
   if (equationValueString == ''):
    return bracketEndIndex
   else:
    evaluators[valueBeginIndex] = EvaluatorValue(equationValueString)
    valueDeleteIndex = (valueBeginIndex + 1)
    del evaluators[valueDeleteIndex:valueEvaluatorIndex]
   return ((bracketEndIndex - valueEvaluatorIndex) + valueDeleteIndex)
  equationValueString += valueEvaluator.word
 return bracketEndIndex

def getEndIndexConvertEquationValue ( bracketEndIndex , evaluatorIndex , evaluators ) : evaluator = evaluators [ evaluatorIndex ] if ( evaluator . __class__ != EvaluatorValue ) : return bracketEndIndex if ( not evaluator . word . startswith ( 'equation.' ) ) : return bracketEndIndex if ( evaluators [ ( evaluatorIndex + 1 ) ] . word != ':' ) : return bracketEndIndex valueBeginIndex = ( evaluatorIndex + 2 ) equationValueString = '' for valueEvaluatorIndex in xrange ( valueBeginIndex , len ( evaluators ) ) : valueEvaluator = evaluators [ valueEvaluatorIndex ] if ( ( valueEvaluator . word == ',' ) or ( valueEvaluator . word == '}' ) ) : if ( equationValueString == '' ) : return bracketEndIndex else : evaluators [ valueBeginIndex ] = EvaluatorValue ( equationValueString ) valueDeleteIndex = ( valueBeginIndex + 1 ) del evaluators [ valueDeleteIndex : valueEvaluatorIndex ] return ( ( bracketEndIndex - valueEvaluatorIndex ) + valueDeleteIndex ) equationValueString += valueEvaluator . word return bracketEndIndex
get the bracket end index and convert the equation value evaluators into a string .