Exemplo n.º 1
0
 public static boolean isNullConstant(@NotNull JetExpression expression) {
   JetExpression deparenthesized = deparenthesize(expression);
   return deparenthesized instanceof JetConstantExpression
       && deparenthesized.getNode().getElementType() == JetNodeTypes.NULL;
 }
Exemplo n.º 2
0
  public static boolean isTypeFlexible(@Nullable JetExpression expression) {
    if (expression == null) return false;

    return TokenSet.create(JetNodeTypes.INTEGER_CONSTANT, JetNodeTypes.FLOAT_CONSTANT)
        .contains(expression.getNode().getElementType());
  }