提交 cb326d31 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Reflect the addition of sub in the cop documentation.

上级 4a8da2e8
...@@ -99,7 +99,7 @@ There are less methods to define for an Op than for a Type: ...@@ -99,7 +99,7 @@ There are less methods to define for an Op than for a Type:
module is initialized, before anything else is executed and is module is initialized, before anything else is executed and is
specialized for a particular apply of an :ref:`op`. specialized for a particular apply of an :ref:`op`.
.. method:: c_init_code_struct(node, struct_id) .. method:: c_init_code_struct(node, struct_id, sub)
Allows you to specify code that will be inserted in the struct Allows you to specify code that will be inserted in the struct
constructor of the Op. This is for code which should be constructor of the Op. This is for code which should be
...@@ -108,6 +108,16 @@ There are less methods to define for an Op than for a Type: ...@@ -108,6 +108,16 @@ There are less methods to define for an Op than for a Type:
`struct_id` is an integer guaranteed to be unique inside the `struct_id` is an integer guaranteed to be unique inside the
struct. struct.
`sub` is a dictionary of extras parameters to the
c_code_init_code_struct method. It contains the following
values:
``sub['fail']``
A string of code that you should execute (after ensuring
that a python exception is set) if your C code needs to
raise an exception.
.. method:: c_support_code() .. method:: c_support_code()
Allows you to specify helper functions/structs that the Allows you to specify helper functions/structs that the
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论