/**
* Number literals include integers, decimals, and exponents.
*/
public void testLiteralNumbers() throws Exception {
Expression e = buildExpression("5");
assertEquals("Unexpected expression type", ExpressionType.LITERAL, e.getExpressionType());
LiteralImpl l = (LiteralImpl) e;
assertEquals("Unexpected number literal value", 5.0, l.getValue());
e = buildExpression("5.345");
assertEquals("Unexpected expression type", ExpressionType.LITERAL, e.getExpressionType());
l = (LiteralImpl) e;
assertEquals("Unexpected number literal value", 5.345, l.getValue());
e = buildExpression("911.");
assertEquals("Unexpected expression type", ExpressionType.LITERAL, e.getExpressionType());
l = (LiteralImpl) e;
assertEquals("Unexpected number literal value", 911., l.getValue());
e = buildExpression(".119");
assertEquals("Unexpected expression type", ExpressionType.LITERAL, e.getExpressionType());
l = (LiteralImpl) e;
assertEquals("Unexpected number literal value", .119, l.getValue());
e = buildExpression("1e10");
assertEquals("Unexpected expression type", ExpressionType.LITERAL, e.getExpressionType());
l = (LiteralImpl) e;
assertEquals("Unexpected number literal value", 1e10, l.getValue());
e = buildExpression("2.e20");
assertEquals("Unexpected expression type", ExpressionType.LITERAL, e.getExpressionType());
l = (LiteralImpl) e;
assertEquals("Unexpected number literal value", 2.e20, l.getValue());
e = buildExpression("0e0");
assertEquals("Unexpected expression type", ExpressionType.LITERAL, e.getExpressionType());
l = (LiteralImpl) e;
assertEquals("Unexpected number literal value", 0e0, l.getValue());
e = buildExpression("1e01");
assertEquals("Unexpected expression type", ExpressionType.LITERAL, e.getExpressionType());
l = (LiteralImpl) e;
assertEquals("Unexpected number literal value", 1e01, l.getValue());
e = buildExpression(".3e3");
assertEquals("Unexpected expression type", ExpressionType.LITERAL, e.getExpressionType());
l = (LiteralImpl) e;
assertEquals("Unexpected number literal value", .3e3, l.getValue());
}