Skip to content

Commit 1c80175

Browse files
authored
Merge pull request github#13009 from MathiasVP/fix-tostring-on-regex-literals
Swift: Fix TODO on regex literals's `toString`
2 parents ea75996 + 1f018d6 commit 1c80175

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| regex.swift:1:5:1:5 | ... | getType: | Regex<Substring> | getPattern: | a.*a | getVersion: | 1 |
2-
| regex.swift:2:5:2:5 | ... | getType: | Regex<(Substring, Substring)> | getPattern: | the number (\\d+) | getVersion: | 1 |
1+
| regex.swift:1:5:1:5 | a.*a | getType: | Regex<Substring> | getPattern: | a.*a | getVersion: | 1 |
2+
| regex.swift:2:5:2:5 | the number (\\d+) | getType: | Regex<(Substring, Substring)> | getPattern: | the number (\\d+) | getVersion: | 1 |
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
private import codeql.swift.generated.expr.RegexLiteralExpr
22

33
class RegexLiteralExpr extends Generated::RegexLiteralExpr {
4-
override string toString() {
5-
result = "..." // TODO: We can improve this once we extract the regex
6-
}
4+
override string toString() { result = this.getPattern() }
75
}

0 commit comments

Comments
 (0)