mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-19 13:36:44 +00: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:
1 parent
153d92b390
commit
34f1a03f7b
21 files changed
+258
-229
No files matched your search
@@ -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