File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
lib/codeql/rust/elements/internal Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ module Impl {
6868 * [1]: https://doc.rust-lang.org/reference/tokens.html#string-literals
6969 */
7070 class StringLiteralExpr extends LiteralExpr {
71- StringLiteralExpr ( ) { this .getTextValue ( ) .regexpMatch ( "r?#*\".*\"#*" ) }
71+ StringLiteralExpr ( ) { this .getTextValue ( ) .charAt ( 0 ) = [ "\"" , "r" ] }
7272
7373 override string getAPrimaryQlClass ( ) { result = "StringLiteralExpr" }
7474 }
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ stringLiteral
1616| literal.rs:21:5:21:8 | r"R" |
1717| literal.rs:22:5:22:11 | "\\\\x52" |
1818| literal.rs:23:5:23:11 | r"\\x52" |
19+ | literal.rs:25:5:29:5 | "\n A normal string literal\n... |
20+ | literal.rs:31:5:34:6 | r#"\n A raw string literal\n ... |
1921integerLiteral
2022| literal.rs:39:5:39:7 | 123 | |
2123| literal.rs:40:5:40:10 | 123i32 | i32 |
You can’t perform that action at this time.
0 commit comments