C++: Add toString for RelationStrictness

This helps for debugging.
This commit is contained in:
Simon Friis Vindum
2025-10-24 16:01:38 +02:00
parent a0a6f288b5
commit 17e0dec08a

View File

@@ -1,10 +1,10 @@
import cpp
/**
* Describes whether a relation is 'strict' (that is, a `<` or `>`
* The strictness of a relation. Either 'strict' (that is, a `<` or `>`
* relation) or 'non-strict' (a `<=` or `>=` relation).
*/
newtype RelationStrictness =
newtype TRelationStrictness =
/**
* Represents that a relation is 'strict' (that is, a `<` or `>` relation).
*/
@@ -14,6 +14,19 @@ newtype RelationStrictness =
*/
Nonstrict()
/**
* The strictness of a relation. Either 'strict' (that is, a `<` or `>`
* relation) or 'non-strict' (a `<=` or `>=` relation).
*/
class RelationStrictness extends TRelationStrictness {
/** Gets the string representation of this relation strictness. */
string toString() {
this = Strict() and result = "strict"
or
this = Nonstrict() and result = "non-strict"
}
}
/**
* Describes whether a relation is 'greater' (that is, a `>` or `>=`
* relation) or 'lesser' (a `<` or `<=` relation).