summaryrefslogtreecommitdiff
path: root/tools/lib/python/kdoc/kdoc_re.py
diff options
context:
space:
mode:
authorRandy Dunlap <rdunlap@infradead.org>2025-11-23 20:10:11 -0800
committerJonathan Corbet <corbet@lwn.net>2025-11-29 08:35:23 -0700
commit5f88f44d8427a97347afda3a6114aed0df472a0b (patch)
tree44536f84236dbbf00acf8e36bf8999864d3c05a7 /tools/lib/python/kdoc/kdoc_re.py
parent18182f9758de45f5ea1e46b95f3a9548a30eb61d (diff)
docs: kdoc: various fixes for grammar, spelling, punctuation
Correct grammar, spelling, and punctuation in comments, strings, print messages, logs. Change two instances of two spaces between words to just one space. codespell was used to find misspelled words. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Cc: Mauro Carvalho Chehab <mchehab@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20251124041011.3030571-1-rdunlap@infradead.org>
Diffstat (limited to 'tools/lib/python/kdoc/kdoc_re.py')
-rw-r--r--tools/lib/python/kdoc/kdoc_re.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/tools/lib/python/kdoc/kdoc_re.py b/tools/lib/python/kdoc/kdoc_re.py
index 612223e1e723..2dfa1bf83d64 100644
--- a/tools/lib/python/kdoc/kdoc_re.py
+++ b/tools/lib/python/kdoc/kdoc_re.py
@@ -16,7 +16,7 @@ re_cache = {}
class KernRe:
"""
- Helper class to simplify regex declaration and usage,
+ Helper class to simplify regex declaration and usage.
It calls re.compile for a given pattern. It also allows adding
regular expressions and define sub at class init time.
@@ -27,7 +27,7 @@ class KernRe:
def _add_regex(self, string, flags):
"""
- Adds a new regex or re-use it from the cache.
+ Adds a new regex or reuses it from the cache.
"""
self.regex = re_cache.get(string, None)
if not self.regex:
@@ -114,7 +114,7 @@ class NestedMatch:
'\\bSTRUCT_GROUP(\\(((?:(?>[^)(]+)|(?1))*)\\))[^;]*;'
- which is used to properly match open/close parenthesis of the
+ which is used to properly match open/close parentheses of the
string search STRUCT_GROUP(),
Add a class that counts pairs of delimiters, using it to match and
@@ -136,13 +136,13 @@ class NestedMatch:
# \bSTRUCT_GROUP\(
#
# is similar to: STRUCT_GROUP\((.*)\)
- # except that the content inside the match group is delimiter's aligned.
+ # except that the content inside the match group is delimiter-aligned.
#
- # The content inside parenthesis are converted into a single replace
+ # The content inside parentheses is converted into a single replace
# group (e.g. r`\1').
#
# It would be nice to change such definition to support multiple
- # match groups, allowing a regex equivalent to.
+ # match groups, allowing a regex equivalent to:
#
# FOO\((.*), (.*), (.*)\)
#
@@ -168,14 +168,14 @@ class NestedMatch:
but I ended using a different implementation to align all three types
of delimiters and seek for an initial regular expression.
- The algorithm seeks for open/close paired delimiters and place them
- into a stack, yielding a start/stop position of each match when the
+ The algorithm seeks for open/close paired delimiters and places them
+ into a stack, yielding a start/stop position of each match when the
stack is zeroed.
- The algorithm shoud work fine for properly paired lines, but will
- silently ignore end delimiters that preceeds an start delimiter.
+ The algorithm should work fine for properly paired lines, but will
+ silently ignore end delimiters that precede a start delimiter.
This should be OK for kernel-doc parser, as unaligned delimiters
- would cause compilation errors. So, we don't need to rise exceptions
+ would cause compilation errors. So, we don't need to raise exceptions
to cover such issues.
"""
@@ -203,7 +203,7 @@ class NestedMatch:
stack.append(end)
continue
- # Does the end delimiter match what it is expected?
+ # Does the end delimiter match what is expected?
if stack and d == stack[-1]:
stack.pop()