Debian Codegraph @

src/sksl/ir/SkSLLiteral.cpp

raw
1 /*
2 * Copyright 2022 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "src/sksl/SkSLString.h"
9 #include "src/sksl/ir/SkSLLiteral.h"
10
11 namespace SkSL {
12
13 std::string Literal::description(OperatorPrecedence) const {
14 if (this->type().isBoolean()) {
15 return fValue ? "true" : "false";
16 }
17 if (this->type().isInteger()) {
18 return std::to_string(this->intValue());
19 }
20 return skstd::to_string(this->floatValue());
21 }
22
23 } // namespace SkSL