mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Rename some classes to match the design better (#1287)
* `FieldAccessExpression` -> `SimpleMemberAccessExpression`
* Member `aggregate` -> `object`
* Member `field` -> `member`
* `CompoundFieldAccessExpression` -> `CompoundMemberAccessExpression`
* `GetField` -> `GetMember`
As discussed in #1233.
This commit is contained in:
@@ -87,16 +87,16 @@ void Expression::Print(llvm::raw_ostream& out) const {
|
||||
switch (kind()) {
|
||||
case ExpressionKind::IndexExpression: {
|
||||
const auto& index = cast<IndexExpression>(*this);
|
||||
out << index.aggregate() << "[" << index.offset() << "]";
|
||||
out << index.object() << "[" << index.offset() << "]";
|
||||
break;
|
||||
}
|
||||
case ExpressionKind::FieldAccessExpression: {
|
||||
const auto& access = cast<FieldAccessExpression>(*this);
|
||||
out << access.aggregate() << "." << access.field();
|
||||
case ExpressionKind::SimpleMemberAccessExpression: {
|
||||
const auto& access = cast<SimpleMemberAccessExpression>(*this);
|
||||
out << access.object() << "." << access.member();
|
||||
break;
|
||||
}
|
||||
case ExpressionKind::CompoundFieldAccessExpression: {
|
||||
const auto& access = cast<CompoundFieldAccessExpression>(*this);
|
||||
case ExpressionKind::CompoundMemberAccessExpression: {
|
||||
const auto& access = cast<CompoundMemberAccessExpression>(*this);
|
||||
out << access.object() << ".(" << access.path() << ")";
|
||||
break;
|
||||
}
|
||||
@@ -242,8 +242,8 @@ void Expression::PrintID(llvm::raw_ostream& out) const {
|
||||
out << "ValueLiteral";
|
||||
break;
|
||||
case ExpressionKind::IndexExpression:
|
||||
case ExpressionKind::FieldAccessExpression:
|
||||
case ExpressionKind::CompoundFieldAccessExpression:
|
||||
case ExpressionKind::SimpleMemberAccessExpression:
|
||||
case ExpressionKind::CompoundMemberAccessExpression:
|
||||
case ExpressionKind::IfExpression:
|
||||
case ExpressionKind::TupleLiteral:
|
||||
case ExpressionKind::StructLiteral:
|
||||
|
||||
Reference in New Issue
Block a user