Lines Matching defs:Literal
22 class Literal : public Expression {
26 Literal(int line, double value, const Type* type)
31 static std::unique_ptr<Literal> MakeFloat(const Context& context, int line, float value) {
32 return std::make_unique<Literal>(line, value, context.fTypes.fFloatLiteral.get());
36 static std::unique_ptr<Literal> MakeFloat(int line, float value, const Type* type) {
38 return std::make_unique<Literal>(line, value, type);
42 static std::unique_ptr<Literal> MakeInt(const Context& context, int line, SKSL_INT value) {
43 return std::make_unique<Literal>(line, value, context.fTypes.fIntLiteral.get());
47 static std::unique_ptr<Literal> MakeInt(int line, SKSL_INT value, const Type* type) {
53 return std::make_unique<Literal>(line, value, type);
57 static std::unique_ptr<Literal> MakeBool(const Context& context, int line, bool value) {
58 return std::make_unique<Literal>(line, value, context.fTypes.fBool.get());
63 static std::unique_ptr<Literal> MakeBool(int line, bool value, const Type* type) {
65 return std::make_unique<Literal>(line, value, type);
69 static std::unique_ptr<Literal> Make(int line, double value, const Type* type) {
119 if (!other.is<Literal>() || this->type().numberKind() != other.type().numberKind()) {
122 return this->value() == other.as<Literal>().value()
128 return std::make_unique<Literal>(fLine, this->value(), &this->type());