Lines Matching defs:ID
35 static Error typeError(StringRef ID, const ASTNodeKind &Kind) {
36 return invalidArgumentError("mismatched type (node id=" + ID +
40 static Error typeError(StringRef ID, const ASTNodeKind &Kind,
43 ExpectedType + " (node id=" + ID +
47 static Error missingPropertyError(StringRef ID, Twine Description,
50 "' (node id=" + ID + ")");
54 StringRef ID) {
56 auto It = NodesMap.find(ID);
58 return invalidArgumentError("ID not bound: " + ID);
127 RangeSelector transformer::node(std::string ID) {
128 return [ID](const MatchResult &Result) -> Expected<CharSourceRange> {
129 Expected<DynTypedNode> Node = getNode(Result.Nodes, ID);
139 RangeSelector transformer::statement(std::string ID) {
140 return [ID](const MatchResult &Result) -> Expected<CharSourceRange> {
141 Expected<DynTypedNode> Node = getNode(Result.Nodes, ID);
173 RangeSelector transformer::member(std::string ID) {
174 return [ID](const MatchResult &Result) -> Expected<CharSourceRange> {
175 Expected<DynTypedNode> Node = getNode(Result.Nodes, ID);
181 return typeError(ID, Node->getNodeKind(), "MemberExpr");
185 RangeSelector transformer::name(std::string ID) {
186 return [ID](const MatchResult &Result) -> Expected<CharSourceRange> {
187 Expected<DynTypedNode> N = getNode(Result.Nodes, ID);
193 return missingPropertyError(ID, "name", "identifier");
207 return missingPropertyError(ID, "name", "identifier");
213 return missingPropertyError(ID, "name", "explicit member initializer");
217 return typeError(ID, Node.getNodeKind(),
231 std::string ID;
234 RelativeSelector(std::string ID) : ID(std::move(ID)) {}
237 Expected<DynTypedNode> N = getNode(Result.Nodes, ID);
242 return typeError(ID, N->getNodeKind());
260 RangeSelector transformer::statements(std::string ID) {
261 return RelativeSelector<CompoundStmt, getStatementsRange>(std::move(ID));
275 RangeSelector transformer::callArgs(std::string ID) {
276 return RelativeSelector<CallExpr, getCallArgumentsRange>(std::move(ID));
289 RangeSelector transformer::initListElements(std::string ID) {
290 return RelativeSelector<InitListExpr, getElementsRange>(std::move(ID));
302 RangeSelector transformer::elseBranch(std::string ID) {
303 return RelativeSelector<IfStmt, getElseRange>(std::move(ID));