TS: Rename IsTypeExpr -> PredicateTypeExpr

This commit is contained in:
Asger F
2019-10-30 14:16:57 +00:00
parent f50f3b48c4
commit 4e7b987fa3
12 changed files with 56 additions and 53 deletions

View File

@@ -1,32 +0,0 @@
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 IsTypeExpr extends TypeExpression {
private final ITypeExpression left; // Always Identifier or KeywordTypeExpr (in case of 'this')
private final ITypeExpression right;
public IsTypeExpr(SourceLocation loc, ITypeExpression left, ITypeExpression right) {
super("IsTypeExpr", loc);
this.left = left;
this.right = right;
}
public ITypeExpression getLeft() {
return left;
}
public ITypeExpression getRight() {
return right;
}
@Override
public <C, R> R accept(Visitor<C, R> v, C c) {
return v.visit(this, c);
}
}

View File

@@ -0,0 +1,34 @@
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;
public PredicateTypeExpr(SourceLocation loc, ITypeExpression expression, ITypeExpression type) {
super("PredicateTypeExpr", loc);
this.expression = expression;
this.type = type;
}
/** 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;
}
@Override
public <C, R> R accept(Visitor<C, R> v, C c) {
return v.visit(this, c);
}
}