33 std::unique_ptr<Expression>
base,
34 std::string_view field) {
38 std::string methodName =
"$" + std::string(field);
41 return std::make_unique<MethodReference>(context,
pos, std::move(
base),
45 std::string(field) +
"'");
50 for (
size_t i = 0;
i < fields.
size();
i++) {
51 if (fields[
i].
fName == field) {
61 "' does not have a field named '" + std::string(field) +
"'");
70 int numFields =
args.size();
71 for (
int index = 0; index < numFields; ++index) {
72 if (fieldIndex == index) {
81 return args[fieldIndex]->clone(
pos);
86 std::unique_ptr<Expression>
base,
110 for (
int index = 0; index <
fieldIndex; ++index) {
111 slot += fields[index].fType->slotCount();
const std::unique_ptr< Type > fSkCaps
static const Expression * GetConstantValueForVariable(const Expression &value)
const BuiltinTypes & fTypes
SymbolTable * fSymbolTable
void error(Position position, std::string_view msg)
const Type & type() const
std::string description() const final
static std::unique_ptr< Expression > Convert(const Context &context, Position pos, std::unique_ptr< Expression > base, std::string_view field)
static std::unique_ptr< Expression > Make(const Context &context, Position pos, std::unique_ptr< Expression > base, int fieldIndex, OwnerKind ownerKind=OwnerKind::kDefault)
std::unique_ptr< Expression > & base()
OwnerKind ownerKind() const
size_t initialSlot() const
ExpressionArray & arguments()
static std::unique_ptr< Expression > Convert(const Context &context, Position pos, const std::string_view &name)
const Symbol * find(std::string_view name) const
bool isEffectChild() const
virtual SkSpan< const Field > fields() const
bool matches(const Type &other) const
std::string displayName() const
virtual bool isStruct() const
constexpr size_t size() const
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
bool HasSideEffects(const Expression &expr)
static std::unique_ptr< Expression > extract_field(Position pos, const ConstructorStruct &ctor, int fieldIndex)