From 88fa6327151ca8da00ea6d308e92282078e80af9 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 28 Apr 2012 15:30:19 +0000 Subject: [PATCH] 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 --- Doc/Manual/Preprocessor.html | 10 ++++++++-- Doc/Manual/Typemaps.html | 10 +++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Doc/Manual/Preprocessor.html b/Doc/Manual/Preprocessor.html index 8d41efccf..332d2a576 100644 --- a/Doc/Manual/Preprocessor.html +++ b/Doc/Manual/Preprocessor.html @@ -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.

-

7.7 Preprocessing and %{ ... %} & " ... " delimiters

+

7.7 Preprocessing and delimiters

+ +

+The preprocessor handles { }, " " and %{ %} delimiters differently. +

+ +

7.7 Preprocessing and %{ ... %} & " ... " delimiters

@@ -331,7 +337,7 @@ the contents of the %{ ... %} block are copied without modification to the output (including all preprocessor directives).

-

7.8 Preprocessing and { ... } delimiters

+

7.8 Preprocessing and { ... } delimiters

diff --git a/Doc/Manual/Typemaps.html b/Doc/Manual/Typemaps.html index b6e8cf3ce..b3b0bc7a9 100644 --- a/Doc/Manual/Typemaps.html +++ b/Doc/Manual/Typemaps.html @@ -3673,17 +3673,21 @@ generated into the wrapper code before any typemap code that calls it.

To define a fragment you need a fragment name, a section name for generating the fragment code into, and the code itself. See Code insertion blocks 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:

+%fragment("my_name", "header") %{ ... %}
 %fragment("my_name", "header") { ... }
 %fragment("my_name", "header") " ... "
 

+and these follow the usual preprocessing rules mentioned in the +Preprocessing delimiters +section. The following are some rules and guidelines for using fragments:

@@ -3761,8 +3765,8 @@ A fragment can use one or more additional fragments, for example:
-%fragment("<limits.h>", "header")  {
-  #include <limits.h>
+%fragment("<limits.h>", "header") {
+  %#include <limits.h>
 }