Skip to contentSkip to conversation

python: Add make_expr and include_match documentation

PATCH Applied Kees Cook 3 participants 3 messages Oct 9, 2022

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 python: Add make_expr and include_match documentation

Add the 'make_expr' and 'include_match' helpers in the Python documentation. Additionally cleans up a markdown-breaking line split.

---
 python/python_documentation.md | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
python/python_documentation.md +17 -2
index d0194d6c1391..1d933b9a3934 100644
@@ -11,13 +11,20 @@ file at the end of the execution of the Python script.
 
 Example: tests/exitp.cocci
 
+## cocci.include_match(state)
+
+If a python rule is running, it has matched. If the match should be
+removed from consideration, this can be called with `state` set to
+`False`.
+
+Example: tests/incpos.cocci
+
 ## cocci.has_env_binding(rule, name)
 
 Returns `true` if the meta-variable `name` is bound in the rule
 `rule`.
 
-## cocci.add_pending_instance(files, virtual_rules, virtual_identifiers,
-       extend_virtual_ids)
+## cocci.add_pending_instance(files, virtual_rules, virtual_identifiers, extend_virtual_ids)
 
 Internal function for the method iteration.register().
 
@@ -28,9 +35,17 @@ Converts the string `id` to a C identifier.
 
 Example: tests/python_mdecl.cocci
 
+## cocci.make_expr(expr)
+
+Converts the thing `expr` to a C expression.
+(Equivalent to Coccilib.make_expr in OCaml.)
+
+Example: tests/python_mdecl.cocci
+
 ## cocci.make_stmt(phrase)
 
 Parses the string `phrase` as a C statement and returns the statement.
+(Equivalent to Coccilib.make_stmt in OCaml.)
 
 Example: tests/python_mdecl.cocci
 
Signature · 1 line
2.34.1
Applied
#1 lore raw
Quoted 4 lines · Kees Cook

Add the 'make_expr' and 'include_match' helpers in the Python documentation. Additionally cleans up a markdown-breaking line split.

Applied, thanks!

julia

Quoted 53 lines
---
 python/python_documentation.md | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
python/python_documentation.md +17 -3
index d0194d6c1391..1d933b9a3934 100644
@@ -11,13 +11,20 @@ file at the end of the execution of the Python script.
 
 Example: tests/exitp.cocci
 
+## cocci.include_match(state)
+
+If a python rule is running, it has matched. If the match should be
+removed from consideration, this can be called with `state` set to
+`False`.
+
+Example: tests/incpos.cocci
+
 ## cocci.has_env_binding(rule, name)
 
 Returns `true` if the meta-variable `name` is bound in the rule
 `rule`.
 
-## cocci.add_pending_instance(files, virtual_rules, virtual_identifiers,
-       extend_virtual_ids)
+## cocci.add_pending_instance(files, virtual_rules, virtual_identifiers, extend_virtual_ids)
 
 Internal function for the method iteration.register().
 
@@ -28,9 +35,17 @@ Converts the string `id` to a C identifier.
 
 Example: tests/python_mdecl.cocci
 
+## cocci.make_expr(expr)
+
+Converts the thing `expr` to a C expression.
+(Equivalent to Coccilib.make_expr in OCaml.)
+
+Example: tests/python_mdecl.cocci
+
 ## cocci.make_stmt(phrase)
 
 Parses the string `phrase` as a C statement and returns the statement.
+(Equivalent to Coccilib.make_stmt in OCaml.)
 
 Example: tests/python_mdecl.cocci
 
--

2.34.1

#2 lore raw
Quoted 2 lines
Quoted 2 lines

Add the 'make_expr' and 'include_match' helpers in the Python documentation. Additionally cleans up a markdown-breaking line split.

…

Quoted 1 line

Applied, thanks!

I wonder how such a response fits to known patch guidelines.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=adb95582a09f24201e071732824aef53593020e2#n81
https://github.com/coccinelle/coccinelle/pull/290#pullrequestreview-1135372979

Regards,
Markus