Skip to content

Commit 83860ac

Browse files
committed
Swift: Test BuiltinLiteralExpr.
1 parent f2b1e09 commit 83860ac

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
| builtinliteralexpr.swift:4:6:4:6 | 1 | 1 |
2+
| builtinliteralexpr.swift:5:6:5:6 | 0xFF | 0xFF |
3+
| builtinliteralexpr.swift:6:6:6:6 | 2.34 | 2.34 |
4+
| builtinliteralexpr.swift:7:6:7:6 | true | true |
5+
| builtinliteralexpr.swift:8:6:8:6 | abc | abc |
6+
| builtinliteralexpr.swift:9:6:9:6 | \u2872 | \u2872 |
7+
| builtinliteralexpr.swift:11:7:11:7 | 5 | 5 |
8+
| builtinliteralexpr.swift:12:7:12:7 | 6 | 6 |
9+
| builtinliteralexpr.swift:12:10:12:10 | 7 | 7 |
10+
| builtinliteralexpr.swift:13:6:13:6 | #... | |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import swift
2+
3+
from BuiltinLiteralExpr e
4+
where e.getFile().getBaseName() != ""
5+
select e, concat(e.getValueString(), "")
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
func test() {
3+
// builtin literals
4+
_ = 1
5+
_ = 0xFF
6+
_ = 2.34
7+
_ = true
8+
_ = "abc"
9+
_ = "" // (braille)
10+
let maybe: Int? = nil // (no BuiltinLiteralExpr)
11+
_ = [5]
12+
_ = [6: 7]
13+
_ = #line
14+
}

0 commit comments

Comments
 (0)