Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1de12e7 commit bb89b25Copy full SHA for bb89b25
3 files changed
java/kotlin-extractor/src/main/kotlin/KotlinExtractorExtension.kt
@@ -471,6 +471,20 @@ class KotlinFileExtractor(val tw: TrapWriter) {
471
tw.writeExprs_booleanliteral(id, typeId, parent, idx)
472
tw.writeHasLocation(id, locId)
473
tw.writeNamestrings(v.toString(), v.toString(), id)
474
+ } is Char -> {
475
+ val id = tw.getFreshIdLabel<DbCharacterliteral>()
476
+ val typeId = useType(e.type)
477
+ val locId = tw.getLocation(e.startOffset, e.endOffset)
478
+ tw.writeExprs_characterliteral(id, typeId, parent, idx)
479
+ tw.writeHasLocation(id, locId)
480
+ tw.writeNamestrings(v.toString(), v.toString(), id)
481
+ } is String -> {
482
+ val id = tw.getFreshIdLabel<DbStringliteral>()
483
484
485
+ tw.writeExprs_stringliteral(id, typeId, parent, idx)
486
487
488
} else -> {
489
if(v == null) {
490
extractorBug("Unrecognised IrConst: null value")
java/ql/test/kotlin/library-tests/exprs/exprs.expected
@@ -32,14 +32,17 @@
32
| exprs.kt:20:20:20:20 | y |
33
| exprs.kt:23:14:23:17 | true |
34
| exprs.kt:24:14:24:18 | false |
35
-| exprs.kt:28:12:28:14 | 123 |
36
-| exprs.kt:28:12:28:20 | ... + ... |
37
-| exprs.kt:28:18:28:20 | 456 |
+| exprs.kt:28:13:28:15 | x |
+| exprs.kt:29:16:29:25 | string lit |
+| exprs.kt:30:12:30:14 | 123 |
38
+| exprs.kt:30:12:30:20 | ... + ... |
39
+| exprs.kt:30:18:30:20 | 456 |
40
| file://:0:0:0:0 | b1 |
41
| file://:0:0:0:0 | b2 |
42
| file://:0:0:0:0 | b3 |
43
| file://:0:0:0:0 | b4 |
44
| file://:0:0:0:0 | b5 |
45
+| file://:0:0:0:0 | c |
46
| file://:0:0:0:0 | i1 |
47
| file://:0:0:0:0 | i2 |
48
| file://:0:0:0:0 | i3 |
@@ -60,3 +63,4 @@
60
63
| file://:0:0:0:0 | i18 |
61
64
| file://:0:0:0:0 | i20 |
62
65
| file://:0:0:0:0 | i21 |
66
+| file://:0:0:0:0 | str |
java/ql/test/kotlin/library-tests/exprs/exprs.kt
@@ -25,6 +25,8 @@ fun topLevelMethod(x: Int, y: Int): Int {
25
val b3 = b1 && b2
26
val b4 = b1 || b2
27
val b5 = !b1
28
+ val c = 'x'
29
+ val str = "string lit"
30
return 123 + 456
31
}
0 commit comments