renamed "hasTypeKeyword" to "has_type_keyword"

This commit is contained in:
Erik Krogh Kristensen
2020-09-04 11:52:00 +02:00
parent 007447b0ad
commit 8c969f0539
7 changed files with 14 additions and 7 deletions

View File

@@ -1575,7 +1575,7 @@ public class ASTExtractor {
IdContext.export; IdContext.export;
visitAll(nd.getSpecifiers(), lbl, childContext, 0); visitAll(nd.getSpecifiers(), lbl, childContext, 0);
if (nd.hasTypeKeyword()) { if (nd.hasTypeKeyword()) {
trapwriter.addTuple("hasTypeKeyword", lbl); trapwriter.addTuple("has_type_keyword", lbl);
} }
return lbl; return lbl;
} }
@@ -1596,7 +1596,7 @@ public class ASTExtractor {
visitAll(nd.getSpecifiers(), lbl, childContext, 0); visitAll(nd.getSpecifiers(), lbl, childContext, 0);
emitNodeSymbol(nd, lbl); emitNodeSymbol(nd, lbl);
if (nd.hasTypeKeyword()) { if (nd.hasTypeKeyword()) {
trapwriter.addTuple("hasTypeKeyword", lbl); trapwriter.addTuple("has_type_keyword", lbl);
} }
return lbl; return lbl;
} }

View File

@@ -150,7 +150,7 @@ class ASTNode extends @ast_node, NodeInStmtContainer {
or or
has_declare_keyword(this) has_declare_keyword(this)
or or
hasTypeKeyword(this) has_type_keyword(this)
or or
// An export such as `export declare function f()` should be seen as ambient. // An export such as `export declare function f()` should be seen as ambient.
has_declare_keyword(this.(ExportNamedDeclaration).getOperand()) has_declare_keyword(this.(ExportNamedDeclaration).getOperand())

View File

@@ -190,3 +190,8 @@ deprecated predicate hasProtectedKeyword(Property prop) { has_protected_keyword(
* Use `FieldDeclaration#isReadonly()` instead. * Use `FieldDeclaration#isReadonly()` instead.
*/ */
deprecated predicate hasReadonlyKeyword(Property prop) { has_readonly_keyword(prop) } deprecated predicate hasReadonlyKeyword(Property prop) { has_readonly_keyword(prop) }
/**
* Alias for the predicate `has_type_keyword` defined in the .dbscheme.
* Use the `isTypeOnly` method on the `ImportDeclaration`/`ExportDeclaration` classes instead.
*/
deprecated predicate hasTypeKeyword(ASTNode id) { has_type_keyword(id) }

View File

@@ -78,7 +78,7 @@ class ImportDeclaration extends Stmt, Import, @importdeclaration {
} }
/** Holds if this is declared with the `type` keyword, so it only imports types. */ /** Holds if this is declared with the `type` keyword, so it only imports types. */
predicate isTypeOnly() { hasTypeKeyword(this) } predicate isTypeOnly() { has_type_keyword(this) }
} }
/** A literal path expression appearing in an `import` declaration. */ /** A literal path expression appearing in an `import` declaration. */
@@ -261,7 +261,7 @@ abstract class ExportDeclaration extends Stmt, @exportdeclaration {
abstract DataFlow::Node getSourceNode(string name); abstract DataFlow::Node getSourceNode(string name);
/** Holds if is declared with the `type` keyword, so only types are exported. */ /** Holds if is declared with the `type` keyword, so only types are exported. */
predicate isTypeOnly() { hasTypeKeyword(this) } predicate isTypeOnly() { has_type_keyword(this) }
} }
/** /**

View File

@@ -524,7 +524,7 @@ has_public_keyword (int id: @property ref);
has_private_keyword (int id: @property ref); has_private_keyword (int id: @property ref);
has_protected_keyword (int id: @property ref); has_protected_keyword (int id: @property ref);
has_readonly_keyword (int id: @property ref); has_readonly_keyword (int id: @property ref);
hasTypeKeyword (int id: @import_or_export_declaration ref); has_type_keyword (int id: @import_or_export_declaration ref);
isOptionalMember (int id: @property ref); isOptionalMember (int id: @property ref);
hasDefiniteAssignmentAssertion (int id: @field_or_vardeclarator ref); hasDefiniteAssignmentAssertion (int id: @field_or_vardeclarator ref);
isOptionalParameterDeclaration (unique int parameter: @pattern ref); isOptionalParameterDeclaration (unique int parameter: @pattern ref);

View File

@@ -7996,7 +7996,7 @@
<dependencies/> <dependencies/>
</relation> </relation>
<relation> <relation>
<name>hasTypeKeyword</name> <name>has_type_keyword</name>
<cardinality>1000</cardinality> <cardinality>1000</cardinality>
<columnsizes> <columnsizes>
<e> <e>

View File

@@ -50,3 +50,5 @@ has_protected_keyword.rel: reorder hasProtectedKeyword.rel(int prop) prop
hasProtectedKeyword.rel: delete hasProtectedKeyword.rel: delete
has_readonly_keyword.rel: reorder hasReadonlyKeyword.rel(int prop) prop has_readonly_keyword.rel: reorder hasReadonlyKeyword.rel(int prop) prop
hasReadonlyKeyword.rel: delete hasReadonlyKeyword.rel: delete
has_type_keyword.rel: reorder hasTypeKeyword.rel(int id) id
hasTypeKeyword.rel: delete