Lines Matching refs:index
21 static bool index_out_of_range(const Context& context, SKSL_INT index, const Expression& base) {
22 if (index >= 0 && index < base.type().columns()) {
26 context.fErrors->error(base.fLine, "index " + to_string(index) + " out of range for '" +
55 std::unique_ptr<Expression> index) {
59 SKSL_INT arraySize = baseType.convertArraySize(context, std::move(index));
66 // Convert an index expression with an expression inside of it: `arr[a * 3]`.
73 if (!index->type().isInteger()) {
74 index = context.fTypes.fInt->coerceExpression(std::move(index), context);
75 if (!index) {
80 const Expression* indexExpr = ConstantFolder::GetConstantValueForVariable(*index);
87 return IndexExpression::Make(context, std::move(base), std::move(index));
92 std::unique_ptr<Expression> index) {
95 SkASSERT(index->type().isInteger());
97 const Expression* indexExpr = ConstantFolder::GetConstantValueForVariable(*index);
108 // Indexing an constant array constructor with a constant index can just pluck out
152 return std::make_unique<IndexExpression>(context, std::move(base), std::move(index));