forward toString() etc. predicates from YamlNode to Locatable

This commit is contained in:
erik-krogh
2023-04-11 15:37:01 +02:00
parent b5e90483f5
commit 3c4bd5b6a7
2 changed files with 10 additions and 1 deletions

View File

@@ -51,7 +51,7 @@ private predicate isNotNeeded(Locatable el) {
private string getQlClass(Locatable el) {
result = "[" + el.getPrimaryQlClasses() + "] "
// Alternative implementation -- do not delete. It is useful for QL class discovery.
// not el.getAPrimaryQlClass() = "???" and result = "[" + getPrimaryQlClasses() + "] " or el.getAPrimaryQlClass() = "???" and result = "??[" + concat(el.getAQlClass(), ",") + "] "
// not el.getAPrimaryQlClass() = "???" and result = "[" + el.getPrimaryQlClasses() + "] " or el.getAPrimaryQlClass() = "???" and result = "??[" + concat(el.getAQlClass(), ",") + "] "
}
/**

View File

@@ -48,6 +48,15 @@ private module YamlSig implements LibYaml::InputSig {
import LibYaml::Make<YamlSig>
// private class to forward the `toString` etc. predicates from `YamlNode` to `Locatable`.
private class MyYmlNode extends Locatable instanceof YamlNode {
override string getAPrimaryQlClass() { result = YamlNode.super.getAPrimaryQlClass() }
override Location getLocation() { result = YamlNode.super.getLocation() }
override string toString() { result = YamlNode.super.toString() }
}
/** DEPRECATED: Alias for YamlNode */
deprecated class YAMLNode = YamlNode;