Lines Matching +full:in +full:- +full:and +full:- +full:around
1 # SPDX-License-Identifier: GPL-2.0
4 # Apply kernel-specific tweaks after the initial document processing
29 RE_function = re.compile(r'\b(([a-zA-Z_]\w+)\(\))', flags=ascii_p3)
32 # Sphinx 2 uses the same :c:type role for struct, union, enum and typedef
34 RE_generic_type = re.compile(r'\b(struct|union|enum|typedef)\s+([a-zA-Z_]\w+)',
38 # Sphinx 3 uses a different C role for each one of struct, union, enum and
41 RE_struct = re.compile(r'\b(struct)\s+([a-zA-Z_]\w+)', flags=ascii_p3)
42 RE_union = re.compile(r'\b(union)\s+([a-zA-Z_]\w+)', flags=ascii_p3)
43 RE_enum = re.compile(r'\b(enum)\s+([a-zA-Z_]\w+)', flags=ascii_p3)
44 RE_typedef = re.compile(r'\b(typedef)\s+([a-zA-Z_]\w+)', flags=ascii_p3)
50 RE_doc = re.compile(r'(\bDocumentation/)?((\.\./)*[\w\-/]+)\.(rst|txt)')
55 # Reserved C words that we should skip when cross-referencing
61 # Many places in the docs refer to common system calls. It is
62 # pointless to try to cross-reference them and, as has been known
64 # to the creation of incorrect and confusing cross references. So
76 RE_git = re.compile(r'commit\s+(?P<rev>[0-9a-f]{12,40})(?:\s+\(".*?"\))?',
103 match_iterators = [regex.finditer(t) for regex in markup_func]
105 # Sort all references by the starting position in text
108 for m in sorted_matches:
116 # Call the function associated with the regex that matched this text and
127 # Keep track of cross-reference lookups that failed so we don't have to
132 return (target) in failed_lookups
137 # In sphinx3 we can cross-reference to C macro and function, each one with its
149 # Check if this document has a namespace, and if so, try
150 # cross-referencing inside it first.
154 if base_target not in Skipnames:
155 for target in possible_targets:
156 if (target not in Skipfuncs) and not failure_seen(target):
157 lit_text = nodes.literal(classes=['xref', 'c', 'c-func'])
166 # work around that by ignoring them.
183 RE_function: 'c-func',
184 RE_generic_type: 'c-type',
186 RE_struct: 'c-struct',
187 RE_union: 'c-union',
188 RE_enum: 'c-enum',
189 RE_typedef: 'c-type',
209 # Check if this document has a namespace, and if so, try
210 # cross-referencing inside it first.
214 if base_target not in Skipnames:
215 for target in possible_targets:
216 if not (match.re == RE_function and target in Skipfuncs):
225 # work around that by ignoring them.
258 # work around that by ignoring them.
276 for l in f:
283 # While we could probably assume that we are running in a git
286 # validity. (Maybe we can do something in the future to warn about
298 # avoid adding cross-references to functions that have been explicitly
317 for para in doctree.traverse(nodes.paragraph):
318 for node in para.traverse(condition=text_but_not_a_reference):
322 app.connect('doctree-resolved', auto_markup)