[[cpphs @ 2004-09-29 16:30:40 by malcolm]
malcolm**20040929163040
Tidy up tabular information. Add notes about non-expansion of macros
inside Haskell comments+strings, and blindly recursive expansions.
] {
hunk ./docs/index.html 48
-So, it seemed right to attempt to provide an alternative to cpp,
-both more compatible with Haskell, and itself written in Haskell so
-that it can be distributed with compilers.
+So, it seemed right to provide an alternative to cpp, both more
+compatible with Haskell, and itself written in Haskell so that it
+can be distributed with compilers.
hunk ./docs/index.html 70
-
-- #ifdef
- simple conditional compilation
-- #if
- the full boolean language of defined(),
- &&, ||, ==, etc.
-- #elif
- chained conditionals
-- #define
- in-line definitions (text replacements and macros)
-- #undef
- in-line revocation of definitions
-- #include
- file inclusion
-- #line
- line number directives
-- \\n
- line continuations within all # directives
-- /**/
- token catenation within a macro definition
-- ##
- ANSI-style token catenation
-- #
- ANSI-style token stringisation
-- __FILE__
- special text replacement for DIY error messages
-- __LINE__
- special text replacement for DIY error messages
-- __DATE__
- special text replacement
-- __TIME__
- special text replacement
-
+
+#ifdef | simple conditional compilation |
+#if | the full boolean language of defined(),
+ &&, ||, ==, etc. |
+#elif | chained conditionals |
+#define | in-line definitions (text replacements and macros) |
+#undef | in-line revocation of definitions |
+#include | file inclusion |
+#line | line number directives |
+\\n | line continuations within all # directives |
+/**/ | token catenation within a macro definition |
+## | ANSI-style token catenation |
+# | ANSI-style token stringisation |
+__FILE__ | special text replacement for DIY error messages |
+__LINE__ | special text replacement for DIY error messages |
+__DATE__ | special text replacement |
+__TIME__ | special text replacement |
+
hunk ./docs/index.html 124
-
-- -Dsym
- define a textual replacement (default value is 1)
-- -Dsym=val
- define a textual replacement with a specific value
-- -Ipath
- add a directory to the search path for #include's
-- -Ofile
- specify a file for output (default is stdout)
-- --nomacro
- only process #ifdef's and #include's,
- do not expand macros
-- --noline
- remove #line droppings from the output
-- --strip
- convert C-style comments to whitespace, even outside
- cpp directives
-- --hashes
- recognise the ANSI # stringise operator, and ## for
- token catenation, within macros
-- --layout
- preserve newlines within macro expansions
-- --version
- report version number of cpphs and stop
-
+
+-Dsym |
+ define a textual replacement (default value is 1) |
+-Dsym=val |
+ define a textual replacement with a specific value |
+-Ipath |
+ add a directory to the search path for #include's |
+-Ofile |
+ specify a file for output (default is stdout) |
+--nomacro |
+ only process #ifdef's and #include's, do not expand macros |
+--noline |
+ remove #line droppings from the output |
+--strip |
+ convert C-style comments to whitespace, even outside
+ cpp directives |
+--hashes |
+ recognise the ANSI # stringise operator, and ## for
+ token catenation, within macros |
+--layout |
+ preserve newlines within macro expansions |
+--version |
+ report version number of cpphs and stop |
+
hunk ./docs/index.html 295
+ Macros are never expanded within Haskell comments, strings,
+ or character constants.
+ Macros are always expanded recursively, unlike ANSI, which detects
+ and prevents self-recursion. For instance, #define foo x:foo
+ expands foo once only to x:foo in ANSI, but in cpphs
+ it becomes an infinite list x:x:x:x:..., i.e. cpphs does not
+ terminate.
hunk ./docs/index.html 304
-Macro language
+Macro definition language
}