File tree Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 3
3
*/
4
4
5
5
private import codeql.regex.RegexTreeView
6
+ private import codeql.util.Numbers
6
7
7
8
/**
8
9
* Classes and predicates that create an NFA and various algorithms for working with it.
@@ -1330,18 +1331,6 @@ module Make<RegexTreeViewSig TreeImpl> {
1330
1331
else result = "\\u" + to4digitHex ( any ( int i | i .toUnicode ( ) = char ) )
1331
1332
}
1332
1333
1333
- /**
1334
- * Gets a 4-digit hex representation of `i`.
1335
- */
1336
- bindingset [ i]
1337
- string to4digitHex ( int i ) {
1338
- result =
1339
- "0123456789abcdef" .charAt ( i .bitShiftRight ( 12 ) .bitAnd ( 15 ) ) +
1340
- "0123456789abcdef" .charAt ( i .bitShiftRight ( 8 ) .bitAnd ( 15 ) ) +
1341
- "0123456789abcdef" .charAt ( i .bitShiftRight ( 4 ) .bitAnd ( 15 ) ) +
1342
- "0123456789abcdef" .charAt ( i .bitAnd ( 15 ) )
1343
- }
1344
-
1345
1334
/** Holds if `char` is easily printable char, or whitespace. */
1346
1335
private predicate isPrintable ( string char ) {
1347
1336
exists ( ascii ( char ) )
Original file line number Diff line number Diff line change @@ -3,4 +3,5 @@ version: 0.1.2-dev
3
3
groups : shared
4
4
library : true
5
5
dependencies :
6
+ codeql/util : ${workspace}
6
7
warnOnImplicitThis : true
Original file line number Diff line number Diff line change @@ -100,6 +100,18 @@ private int toHex(string hex) {
100
100
result = 15 and hex = [ "f" , "F" ]
101
101
}
102
102
103
+ /**
104
+ * Gets a 4-digit hex representation of `i`.
105
+ */
106
+ bindingset [ i]
107
+ string to4digitHex ( int i ) {
108
+ result =
109
+ "0123456789abcdef" .charAt ( i .bitShiftRight ( 12 ) .bitAnd ( 15 ) ) +
110
+ "0123456789abcdef" .charAt ( i .bitShiftRight ( 8 ) .bitAnd ( 15 ) ) +
111
+ "0123456789abcdef" .charAt ( i .bitShiftRight ( 4 ) .bitAnd ( 15 ) ) +
112
+ "0123456789abcdef" .charAt ( i .bitAnd ( 15 ) )
113
+ }
114
+
103
115
/**
104
116
* Gets the value of 16 to the power of `n`. Holds only for `n` in the range
105
117
* 0..7 (inclusive).
You can’t perform that action at this time.
0 commit comments