mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
change all expression and statement pointers to be const (#449)
* change all expression and statement pointers to be const * const in paren tests
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace Carbon {
|
||||
|
||||
Expression* ParenContents::AsExpression(int line_number) const {
|
||||
const Expression* ParenContents::AsExpression(int line_number) const {
|
||||
if (fields_.size() == 1 && fields_.front().name == "" &&
|
||||
has_trailing_comma_ == HasTrailingComma::No) {
|
||||
return fields_.front().expression;
|
||||
@@ -15,8 +15,9 @@ Expression* ParenContents::AsExpression(int line_number) const {
|
||||
}
|
||||
}
|
||||
|
||||
Expression* ParenContents::AsTuple(int line_number) const {
|
||||
auto vec = new std::vector<std::pair<std::string, Carbon::Expression*>>();
|
||||
const Expression* ParenContents::AsTuple(int line_number) const {
|
||||
auto vec =
|
||||
new std::vector<std::pair<std::string, const Carbon::Expression*>>();
|
||||
for (const FieldInitializer& initializer : fields_) {
|
||||
vec->push_back({initializer.name, initializer.expression});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user