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