std::unique_ptr<Expression> Symbol::instantiate(const Context& context, Position pos) const { switch (this->kind()) { case Symbol::Kind::kFunctionDeclaration: return std::make_unique<FunctionReference>(
context, pos, &this->as<FunctionDeclaration>());
case Symbol::Kind::kVariable: { const Variable* var = &this->as<Variable>(); // default to kRead_RefKind; this will be corrected later if the variable is written to return VariableReference::Make(pos, var, VariableReference::RefKind::kRead);
} case Symbol::Kind::kField: { const FieldSymbol* field = &this->as<FieldSymbol>(); auto base = VariableReference::Make(
pos, &field->owner(), VariableReference::RefKind::kRead); return FieldAccess::Make(context,
pos,
std::move(base),
field->fieldIndex(),
FieldAccess::OwnerKind::kAnonymousInterfaceBlock);
} case Symbol::Kind::kType: return TypeReference::Convert(context, pos, &this->as<Type>());
default:
SkDEBUGFAILF("unsupported symbol type %d\n", fKind); return nullptr;
}
}
} // namespace SkSL
Messung V0.5
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.