mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Rust: Handle string literals with line breaks
This commit is contained in:
@@ -68,7 +68,7 @@ module Impl {
|
||||
* [1]: https://doc.rust-lang.org/reference/tokens.html#string-literals
|
||||
*/
|
||||
class StringLiteralExpr extends LiteralExpr {
|
||||
StringLiteralExpr() { this.getTextValue().regexpMatch("r?#*\".*\"#*") }
|
||||
StringLiteralExpr() { this.getTextValue().charAt(0) = ["\"", "r"] }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "StringLiteralExpr" }
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ stringLiteral
|
||||
| literal.rs:21:5:21:8 | r"R" |
|
||||
| literal.rs:22:5:22:11 | "\\\\x52" |
|
||||
| literal.rs:23:5:23:11 | r"\\x52" |
|
||||
| literal.rs:25:5:29:5 | "\n A normal string literal\n... |
|
||||
| literal.rs:31:5:34:6 | r#"\n A raw string literal\n ... |
|
||||
integerLiteral
|
||||
| literal.rs:39:5:39:7 | 123 | |
|
||||
| literal.rs:40:5:40:10 | 123i32 | i32 |
|
||||
|
||||
Reference in New Issue
Block a user