25 result +=
"if (" + this->
test()->description() +
") " + this->
ifTrue()->description();
27 result +=
" else " + this->
ifFalse()->description();
34 std::unique_ptr<Expression>
test,
35 std::unique_ptr<Statement> ifTrue,
36 std::unique_ptr<Statement> ifFalse) {
53 return (stmt && (!isEmpty || stmt->is<
Nop>())) ? std::move(stmt)
59 std::unique_ptr<Expression>
test,
60 std::unique_ptr<Statement> ifTrue,
61 std::unique_ptr<Statement> ifFalse) {
67 bool trueIsEmpty =
false;
68 bool falseIsEmpty =
false;
72 trueIsEmpty =
ifTrue->isEmpty();
74 if (trueIsEmpty && falseIsEmpty) {
99 return std::make_unique<IfStatement>(
static SkTileMode optimize(SkTileMode tm, int dimension)
const std::unique_ptr< Type > fBool
static const Expression * GetConstantValueForVariable(const Expression &value)
const BuiltinTypes & fTypes
static std::unique_ptr< Statement > Make(const Context &context, std::unique_ptr< Expression > expr)
bool isBoolLiteral() const
static std::unique_ptr< Statement > Convert(const Context &context, Position pos, std::unique_ptr< Expression > test, std::unique_ptr< Statement > ifTrue, std::unique_ptr< Statement > ifFalse)
std::string description() const override
static std::unique_ptr< Statement > Make(const Context &context, Position pos, std::unique_ptr< Expression > test, std::unique_ptr< Statement > ifTrue, std::unique_ptr< Statement > ifFalse)
std::unique_ptr< Expression > & test()
std::unique_ptr< Statement > & ifTrue()
std::unique_ptr< Statement > & ifFalse()
SKSL_INT boolValue() const
static std::unique_ptr< Statement > Make()
bool DetectVarDeclarationWithoutScope(const Statement &stmt, ErrorReporter *errors=nullptr)
static std::unique_ptr< Statement > replace_empty_with_nop(std::unique_ptr< Statement > stmt, bool isEmpty)
ProgramSettings fSettings