use shouldPrint to filter out regular expressions from other files

This commit is contained in:
Erik Krogh Kristensen
2021-05-10 14:51:13 +02:00
parent d6f9e37e39
commit 504c34ed2c

View File

@@ -74,7 +74,11 @@ private newtype TPrintAstNode =
THTMLAttributeNode(HTML::Attribute attr) { shouldPrint(attr, _) and not isNotNeeded(attr) } or
THTMLScript(Script script) { shouldPrint(script, _) and not isNotNeeded(script) } or
THTMLCodeInAttr(CodeInAttribute attr) { shouldPrint(attr, _) and not isNotNeeded(attr) } or
TRegExpTermNode(RegExpTerm term) { term.isUsedAsRegExp() }
TRegExpTermNode(RegExpTerm term) {
shouldPrint(term, _) and
term.isUsedAsRegExp() and
any(RegExpLiteral lit).getRoot() = term.getRootTerm()
}
/**
* A node in the output tree.