Lines Matching full:matcher
12 # Each matcher is documented in one row of the form:
15 # becoming visible via javascript when the user clicks the matcher name.
26 # We output multiple rows per matcher if the matcher can be used on multiple
50 return r'Matcher<<a href="%s">%s</a>>' % (url, name)
54 r'Matcher<([^\*&]+)>', link_if_exists, text)
60 We allow annotations in the comment of the matcher to specify what
61 nodes a matcher can match on. Those comments have the form:
62 Usable as: Any Matcher | (Matcher<T1>[, Matcher<t2>[, ...]])
64 Returns ['*'] in case of 'Any Matcher', or ['T1', 'T2', ...].
69 m = re.search(r'Usable as: Any Matcher[\s\n]*$', comment, re.S)
73 m = re.match(r'^(.*)Matcher<([^>]+)>\s*,?[\s\n]*$', comment, re.S)
100 args = re.sub(r'(^|\s)M\d?(\s)', r'\1Matcher<*>\2', args)
104 """Adds a matcher to one of our categories."""
106 # FIXME: Figure out whether we want to support the 'id' matcher.
112 'result': esc('Matcher<%s>' % result_type),
120 # Use a heuristic to figure out whether a matcher is a narrowing or
121 # traversal matcher. By default, matchers that take other matchers as
125 elif ('Matcher<' not in args or
132 """Parse the matcher out of the given declaration and comment.
134 If 'allowed_types' is set, it contains a list of node types the matcher
135 can match on, as extracted from the static type asserts in the matcher
149 add_matcher(result, name, 'Matcher<%s>...' % inner,
153 # Parse the various matcher definition macros.
160 add_matcher('Type', name, 'Matcher<%s>...' % inner,
164 # add_matcher('TypeLoc', '%sLoc' % name, 'Matcher<%sLoc>...' % inner,
182 add_matcher(result_type, name, 'Matcher<Type>', comment)
184 add_matcher('%sLoc' % result_type, '%sLoc' % name, 'Matcher<TypeLoc>',
264 add_matcher('*', name, 'Matcher<*>', comment)
285 add_matcher('*', name, 'Matcher<*>', comment)
288 add_matcher('*', name, 'Matcher<*>, ..., Matcher<*>', comment)
292 # Parse free standing matcher functions, like:
293 # Matcher<ResultType> Name(Matcher<ArgumentType> InnerMatcher) {
301 m = re.match(r'.*\s+internal::(Bindable)?Matcher<([^>]+)>$', result)
332 # body = True: We parse the definition of a matcher. We need
333 # to parse the full definition before adding a matcher, as the
336 # body = False: We parse the comments and declaration of the matcher.