Merge pull request #24176 from nkcsgexi/syntax-disambiguity

Syntax: use child name instead of type name for gyb-generated functions. NFC
This commit is contained in:
Xi Ge
2019-04-19 19:27:30 -07:00
committed by GitHub
6 changed files with 19 additions and 15 deletions

View File

@@ -41,7 +41,8 @@ class Parsed${node.name}Builder {
% if child_node and child_node.is_syntax_collection():
% child_elt = child_node.collection_element_name
% child_elt_type = child_node.collection_element_type
SmallVector<ParsedRawSyntaxNode, 8> ${child_elt}Nodes;
% child_elt_name = child.name + 'Member'
SmallVector<ParsedRawSyntaxNode, 8> ${child_elt_name}s;
% end
% end
@@ -55,7 +56,8 @@ public:
% if child_node and child_node.is_syntax_collection():
% child_elt = child_node.collection_element_name
% child_elt_type = child_node.collection_element_type
Parsed${node.name}Builder &add${child_elt}(Parsed${child_elt_type} ${child_elt});
% child_elt_name = child.name + 'Member'
Parsed${node.name}Builder &add${child_elt_name}(Parsed${child_elt_type} ${child_elt});
% end
% end

View File

@@ -96,7 +96,7 @@ public:
/// `${child.name}` collection.
/// - returns: A copy of the receiver with the provided `${child_elt}`
/// appended to its `${child.name}` collection.
${node.name} add${child_elt}(${child_elt_type} ${child_elt});
${node.name} add${child.name}Member(${child_elt_type} ${child_elt});
% end
/// Returns a copy of the receiver with its `${child.name}` replaced.