package com.semmle.ts.ast;

import com.semmle.js.ast.SourceLocation;
import com.semmle.js.ast.Visitor;

/**
 * A type of form <tt>E is T</tt> where <tt>E</tt> is a parameter name or <tt>this</tt> and
 * <tt>T</tt> is a type.
 */
public class PredicateTypeExpr extends TypeExpression {
  private final ITypeExpression expression;
  private final ITypeExpression type;
  private final boolean hasAssertsKeyword;

  public PredicateTypeExpr(
      SourceLocation loc,
      ITypeExpression expression,
      ITypeExpression type,
      boolean hasAssertsKeyword) {
    super("PredicateTypeExpr", loc);
    this.expression = expression;
    this.type = type;
    this.hasAssertsKeyword = hasAssertsKeyword;
  }

  /** Returns the <tt>E</tt> in <tt>E is T</tt>. */
  public ITypeExpression getExpression() {
    return expression;
  }

  /** Returns the <tt>T</tt> in <tt>E is T</tt>. */
  public ITypeExpression getTypeExpr() {
    return type;
  }

  public boolean hasAssertsKeyword() {
    return hasAssertsKeyword;
  }

  @Override
  public <C, R> R accept(Visitor<C, R> v, C c) {
    return v.visit(this, c);
  }
}

@@ -134,16 +134,63 @@
 s T%3C/tt%3E
+, %3Ctt%3Easserts E is T%3C/tt%3E or %3Ctt%3Easserts E%3C/tt%3E
  where %3C
@@ -201,16 +201,19 @@
 %3C/tt%3E is
+%0A *
  a param
@@ -242,19 +242,16 @@
 /tt%3E and
-%0A *
  %3Ctt%3ET%3C/

Update a javadoc comment