Fix %fragment error in docs and improve preprocessing and delimiters section - SF bug 3519394
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13022 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a0e21e82ca
commit
88fa632715
2 changed files with 15 additions and 5 deletions
|
|
@ -306,7 +306,13 @@ interface building. However, they are used internally to implement a number of
|
|||
SWIG directives and are provided to make SWIG more compatible with C99 code.
|
||||
</p>
|
||||
|
||||
<H2><a name="Preprocessor_nn8"></a>7.7 Preprocessing and %{ ... %} & " ... " delimiters</H2>
|
||||
<H2><a name="Preprocessor_delimiters"></a>7.7 Preprocessing and delimiters</H2>
|
||||
|
||||
<p>
|
||||
The preprocessor handles { }, " " and %{ %} delimiters differently.
|
||||
</p>
|
||||
|
||||
<H3><a name="Preprocessor_nn8"></a>7.7 Preprocessing and %{ ... %} & " ... " delimiters</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -331,7 +337,7 @@ the contents of the <tt>%{ ... %}</tt> block are copied without
|
|||
modification to the output (including all preprocessor directives).
|
||||
</p>
|
||||
|
||||
<H2><a name="Preprocessor_nn9"></a>7.8 Preprocessing and { ... } delimiters</H2>
|
||||
<H3><a name="Preprocessor_nn9"></a>7.8 Preprocessing and { ... } delimiters</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -3673,17 +3673,21 @@ generated into the wrapper code before any typemap code that calls it.
|
|||
<p>
|
||||
To define a fragment you need a fragment name, a section name for generating the fragment code into, and the code itself.
|
||||
See <a href="SWIG.html#SWIG_nn42">Code insertion blocks</a> for a full list of section names.
|
||||
Usually the section name used is "header". Both string and curly braces can be used:
|
||||
Usually the section name used is "header". Different delimiters can be used:
|
||||
</p>
|
||||
|
||||
<div class="code">
|
||||
<pre>
|
||||
%fragment("my_name", "header") %{ ... %}
|
||||
%fragment("my_name", "header") { ... }
|
||||
%fragment("my_name", "header") " ... "
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
and these follow the usual preprocessing rules mentioned in the
|
||||
<a href="Preprocessor.html#Preprocessor_delimiters">Preprocessing delimiters</a>
|
||||
section.
|
||||
The following are some rules and guidelines for using fragments:
|
||||
</p>
|
||||
|
||||
|
|
@ -3761,8 +3765,8 @@ A fragment can use one or more additional fragments, for example:
|
|||
|
||||
<div class="code">
|
||||
<pre>
|
||||
%fragment("<limits.h>", "header") {
|
||||
#include <limits.h>
|
||||
%fragment("<limits.h>", "header") {
|
||||
%#include <limits.h>
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue