Skip to content

Commit 854f2a0

Browse files
committed
Java: Add StringLiteral.isTextBlock().
1 parent a031b2a commit 854f2a0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

java/ql/lib/semmle/code/java/Expr.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,9 @@ class StringLiteral extends Literal, @stringliteral {
726726
*/
727727
string getRepresentedString() { result = getValue() }
728728

729+
/** Holds if this string literal is a text block (`""" ... """`). */
730+
predicate isTextBlock() { getLiteral().matches("\"\"\"%") }
731+
729732
override string getAPrimaryQlClass() { result = "StringLiteral" }
730733
}
731734

0 commit comments

Comments
 (0)