Skip to content

Commit f97b37a

Browse files
committed
Minor formatting fixes in Lua.html
1 parent 3a32956 commit f97b37a

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

Doc/Manual/Lua.html

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ <H3><a name="Lua_commandline">29.2.1 Additional command line options</a></H3>
145145
The following table list the additional commandline options available for the Lua module. They can also be seen by using:
146146
</p>
147147

148-
<div class="code"><pre>
148+
<div class="shell"><pre>
149149
swig -lua -help
150150
</pre></div>
151151

@@ -747,7 +747,8 @@ <H3><a name="Lua_nn14">29.3.7 C++ classes</a></H3>
747747
<p>
748748
Class data members are accessed in the same manner as C structures. Static class members present a special problem for Lua, as Lua doesn't have support for such features. Therefore, SWIG generates wrappers that try to work around some of these issues. To illustrate, suppose you have a class like this:
749749
</p>
750-
<div class="targetlang"><pre>class Spam {
750+
<div class="code"><pre>
751+
class Spam {
751752
public:
752753
static void foo();
753754
static int bar;
@@ -756,7 +757,7 @@ <H3><a name="Lua_nn14">29.3.7 C++ classes</a></H3>
756757
<p>
757758
In Lua, C++ static members can be accessed as follows:
758759
</p>
759-
<div class="code"><pre>
760+
<div class="targetlang"><pre>
760761
&gt; example.Spam.foo() -- calling Spam::foo()
761762
&gt; a=example.Spam.bar -- reading Spam::bar
762763
&gt; example.Spam.bar=b -- writing to Spam::bar
@@ -774,7 +775,7 @@ <H3><a name="Lua_nn14">29.3.7 C++ classes</a></H3>
774775
<b>Compatibility Note:</b> In versions prior to SWIG-3.0.0 only the following names would work:
775776
</p>
776777

777-
<div class="code"><pre>
778+
<div class="targetlang"><pre>
778779
&gt; example.Spam_foo() -- calling Spam::foo()
779780
&gt; a=example.Spam_bar -- reading Spam::bar
780781
&gt; example.Spam_bar=b -- writing to Spam::bar
@@ -964,7 +965,8 @@ <H3><a name="Lua_nn18">29.3.11 C++ operators</a></H3>
964965
<p>
965966
One restriction with operator overloading support is that SWIG is not able to fully handle operators that aren't defined as part of the class. For example, if you had code like this
966967
</p>
967-
<div class="targetlang"><pre>class Complex {
968+
<div class="code"><pre>
969+
class Complex {
968970
...
969971
friend Complex operator+(double, const Complex &amp;c);
970972
...
@@ -973,7 +975,8 @@ <H3><a name="Lua_nn18">29.3.11 C++ operators</a></H3>
973975
<p>
974976
then SWIG doesn't know what to do with the friend function--in fact, it simply ignores it and issues a warning. You can still wrap the operator, but you may have to encapsulate it in a special function. For example:
975977
</p>
976-
<div class="targetlang"><pre>%rename(Complex_add_dc) operator+(double, const Complex &amp;);
978+
<div class="code"><pre>
979+
%rename(Complex_add_dc) operator+(double, const Complex &amp;);
977980
...
978981
Complex operator+(double, const Complex &amp;c);
979982
</pre></div>
@@ -1446,6 +1449,7 @@ <H4><a name="Lua_nn29">29.3.17.2 Names </a></H4>
14461449
If %nspace is enabled, then class namespace is taken as scope. If there is no namespace, or %nspace is disabled,
14471450
then module is considered a class namespace.</p>
14481451
<p> Consider the following C++ code </p>
1452+
14491453
<div class="code"><pre>%module example
14501454
%nspace MyWorld::Test;
14511455
namespace MyWorld {
@@ -1486,6 +1490,7 @@ <H4><a name="Lua_nn30">29.3.17.3 Inheritance </a></H4>
14861490

14871491
<p> The internal organization of inheritance has changed.
14881492
Consider the following C++ code:</p>
1493+
14891494
<div class="code"><pre>%module example
14901495
class Base {
14911496
public:
@@ -1502,6 +1507,7 @@ <H4><a name="Lua_nn30">29.3.17.3 Inheritance </a></H4>
15021507
was copied to <tt>.fn</tt> table of class Derived and so on. This was a recursive procedure, so in the end the whole
15031508
inheritance tree of derived class was squashed into derived class. </p>
15041509
<p> That means that any changes done to class Base after module initialization wouldn't affect class Derived:</p>
1510+
15051511
<div class="targetlang"><pre>
15061512
base = example.Base()
15071513
der = example.Derived()
@@ -1516,6 +1522,8 @@ <H4><a name="Lua_nn30">29.3.17.3 Inheritance </a></H4>
15161522
</pre></div>
15171523
<p> This behaviour was changed. Now unless -squash-bases option is provided, Derived store a list of it's bases and if some symbol is not found in it's own service tables
15181524
then its bases are searched for it. Option -squash-bases will effectively return old behaviour.
1525+
</p>
1526+
15191527
<div class="targetlang"><pre>
15201528
&gt; print(der.new_func) -- Now it works
15211529
function

0 commit comments

Comments
 (0)