public void OptionalWeights(SrndQuery q)
{
Token weight = null;
while (true)
{
switch ((jj_ntk == -1) ? Jj_ntk() : jj_ntk)
{
case RegexpToken.CARAT:
;
break;
default:
jj_la1[9] = jj_gen;
goto label_8;
}
Jj_consume_token(RegexpToken.CARAT);
weight = Jj_consume_token(RegexpToken.NUMBER);
float f;
try
{
// LUCENENET TODO: Test parsing float in various cultures (.NET)
f = float.Parse(weight.image);
}
catch (Exception floatExc)
{
{ if (true) throw new ParseException(boostErrorMessage + weight.image + " (" + floatExc + ")"); }
}
if (f <= 0.0)
{
{ if (true) throw new ParseException(boostErrorMessage + weight.image); }
}
q.Weight = (f * q.Weight); /* left associative, fwiw */
}
label_8: ;
}