From: Kees Cook <keescook@chromium.org>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: Kees Cook <keescook@chromium.org>,
cocci@inria.fr, linux-hardening@vger.kernel.org
Subject: [cocci] [PATCH] python: Add make_expr and include_match documentation
Date: Sun, 9 Oct 2022 11:16:03 -0700 [thread overview]
Message-ID: <20221009181603.3242176-1-keescook@chromium.org> (raw)
Add the 'make_expr' and 'include_match' helpers in the Python
documentation. Additionally cleans up a markdown-breaking line split.
Signed-off-by: Kees Cook <keescook@chromium.org>
---
python/python_documentation.md | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/python/python_documentation.md b/python/python_documentation.md
index d0194d6c1391..1d933b9a3934 100644
--- a/python/python_documentation.md
+++ b/python/python_documentation.md
@@ -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
next reply other threads:[~2022-10-09 18:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-09 18:16 Kees Cook [this message]
2022-10-09 18:21 ` [cocci] [PATCH] python: Add make_expr and include_match documentation Julia Lawall
2022-10-09 18:38 ` Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221009181603.3242176-1-keescook@chromium.org \
--to=keescook@chromium.org \
--cc=cocci@inria.fr \
--cc=julia.lawall@inria.fr \
--cc=linux-hardening@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).