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:
William S Fulton 2012-04-28 15:30:19 +00:00
commit 88fa632715
2 changed files with 15 additions and 5 deletions

View file

@ -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. SWIG directives and are provided to make SWIG more compatible with C99 code.
</p> </p>
<H2><a name="Preprocessor_nn8"></a>7.7 Preprocessing and %{ ... %} &amp; " ... " 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 %{ ... %} &amp; " ... " delimiters</H3>
<p> <p>
@ -331,7 +337,7 @@ the contents of the <tt>%{ ... %}</tt> block are copied without
modification to the output (including all preprocessor directives). modification to the output (including all preprocessor directives).
</p> </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> <p>

View file

@ -3673,17 +3673,21 @@ generated into the wrapper code before any typemap code that calls it.
<p> <p>
To define a fragment you need a fragment name, a section name for generating the fragment code into, and the code itself. 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. 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> </p>
<div class="code"> <div class="code">
<pre> <pre>
%fragment("my_name", "header") %{ ... %}
%fragment("my_name", "header") { ... } %fragment("my_name", "header") { ... }
%fragment("my_name", "header") " ... " %fragment("my_name", "header") " ... "
</pre> </pre>
</div> </div>
<p> <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: The following are some rules and guidelines for using fragments:
</p> </p>
@ -3761,8 +3765,8 @@ A fragment can use one or more additional fragments, for example:
<div class="code"> <div class="code">
<pre> <pre>
%fragment("&lt;limits.h&gt;", "header") { %fragment("&lt;limits.h&gt;", "header") {
#include &lt;limits.h&gt; %#include &lt;limits.h&gt;
} }