mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
TS: Rename IsTypeExpr -> PredicateTypeExpr
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user