mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-12 04:23:54 +00:00
Fix exponent parsing, remove impossible (?) case
(cherry picked from commit 02da42f90b8a912047c00479df789563853cfeee)
This commit is contained in:
@ -612,14 +612,9 @@ class CompilingVisitor extends ExpressionBaseVisitor<MethodHandle> {
|
||||
|
||||
@Override
|
||||
public MethodHandle visitConstantExpression(ExpressionParser.ConstantExpressionContext ctx) {
|
||||
try {
|
||||
return ExpressionHandles.dropData(
|
||||
MethodHandles.constant(Double.class, Double.parseDouble(ctx.getText()))
|
||||
);
|
||||
} catch (NumberFormatException e) {
|
||||
// Rare, but might happen, e.g. if too many digits
|
||||
throw ExpressionHelper.evalException(ctx, "Invalid constant: " + e.getMessage());
|
||||
}
|
||||
return ExpressionHandles.dropData(
|
||||
MethodHandles.constant(Double.class, Double.parseDouble(ctx.getText()))
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user