Changes to AstValidator for BigInt
@@ -325,6 +325,10 @@ public final class AstValidator implements CompilerPass {
validateNumber(n);
return;
+ case BIGINT:
+ validateBigInt(n);
+ return;
+
case NAME:
validateName(n);
return;
@@ -1631,6 +1635,17 @@ public final class AstValidator implements CompilerPass {
}
}
+ private void validateBigInt(Node n) {
+ validateNodeType(Token.BIGINT, n);
+ validateChildCount(n);
+ try {
+ // Validate that getBigInt doesn't throw
+ n.getBigInt();
+ } catch (UnsupportedOperationException e) {
+ violation("Invalid BIGINT node.", n);
+ }
+ }
+
private void validateArrayLit(Node n) {
validateNodeType(Token.ARRAYLIT, n);
for (Node c = n.getFirstChild(); c != null; c = c.getNext()) {
