mirror of
https://github.com/github/codeql.git
synced 2026-02-11 04:31:05 +01:00
add support for boolean literals
This commit is contained in:
committed by
GitHub
parent
4140ce0f10
commit
8ad05b778d
@@ -990,6 +990,21 @@ class Float extends Literal {
|
||||
float getValue() { result = lit.getChild().(Generated::Float).getValue().toFloat() }
|
||||
}
|
||||
|
||||
/** A boolean literal */
|
||||
class Boolean extends Literal {
|
||||
Generated::Bool bool;
|
||||
|
||||
Boolean() { lit.getChild() = bool }
|
||||
|
||||
/** Holds if the value is `true` */
|
||||
predicate isTrue() { bool.getChild() instanceof Generated::True }
|
||||
|
||||
/** Holds if the value is `false` */
|
||||
predicate isFalse() { bool.getChild() instanceof Generated::False }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "Boolean" }
|
||||
}
|
||||
|
||||
/** A comparison symbol, such as `"<"` or `"="`. */
|
||||
class ComparisonSymbol extends string {
|
||||
ComparisonSymbol() {
|
||||
|
||||
Reference in New Issue
Block a user