Commit 4e52c0f0 authored by Nicholas Nethercote's avatar Nicholas Nethercote
Browse files

Bug 1573080 - Fix some incorrect preprocessor.py docs. r=glandium

As shown by python/mozbuild/mozbuild/test/test_preprocessor.py, whitespace is
allowed within expressions, and chained #if/#elif/#else sequences work as you'd
expect.

Differential Revision: https://phabricator.services.mozilla.com/D41494

--HG--
extra : moz-landing-system : lando
parent 9adcf831
Loading
Loading
Loading
Loading
+3 −26
Original line number Diff line number Diff line
@@ -59,8 +59,7 @@ if
   #if variable != string

Disables output if the conditional is false. This can be nested to arbitrary
depths. Note that in the equality checks, the variable must come first, and
the comparison operator must not be surrounded by any whitespace.
depths. Note that in the equality checks, the variable must come first.

else
^^^^
@@ -73,22 +72,6 @@ Reverses the state of the previous conditional block; for example, if the
last ``#if`` was true (output was enabled), an ``#else`` makes it off
(output gets disabled).

.. warning:: An ``#else`` is relative to the last conditional block only,
   unlike the C preprocessor.

   It does not matter whether any blocks before it were true. This behavior
   changed on trunk (Gecko 1.9) on 2006-12-07; see Bug 277122 for details.

::

   #if 1
     always included
   #elif 1
     never included
   #else
     always included
   #endif

endif
^^^^^

@@ -140,12 +123,6 @@ The following two blocks are equivalent::
   #endif
   #endif

.. warning:: An ``#elif``, ``#elifdef``, or ``#elifndef`` is relative to
   the last conditional block only (as well as the condition it implies),
   unlike the C preprocessor. It does not matter whether any blocks before
   it were true. This behavior changed on trunk (Gecko 1.9) on 2006-12-07.
   See Bug 277122 for details.

File Inclusion
--------------