Branch: Tag:


2018-05-19 18:33:28 by Arne Goedeke <>

CPP: fixed refdoc comment


2018-04-19 16:34:32 by Henrik Grubbström (Grubba) <>

Cpp: Moved varargs field to a flag bit.


2018-04-15 11:35:37 by Henrik Grubbström (Grubba) <>

Cpp: Fixed some CPP_MACRO_* flag confusion.


2018-04-12 00:32:45 by Martin Nilsson <>

Silence warning


2018-04-11 15:34:23 by Henrik Grubbström (Grubba) <>

Cpp: Enable the new macro expansion code.


2018-04-09 16:18:53 by Henrik Grubbström (Grubba) <>

Cpp: Fixed whitespace handling in new stringify.


2018-04-07 15:01:14 by Henrik Grubbström (Grubba) <>

Cpp: Fixed macro expansion issue in new code.


2018-04-06 15:06:56 by Henrik Grubbström (Grubba) <>

Cpp: Moved macro expansion to define class.


2018-04-04 16:04:23 by Henrik Grubbström (Grubba) <>

Cpp: Added pointer to containing object to macro program.

This is in preparation for moving apply_define() to a
member function of the macro (aka define) program.


2018-03-31 11:34:50 by Henrik Grubbström (Grubba) <>

Cpp: Added _sprintf() to the CPP context class.


2018-03-30 15:56:07 by Henrik Grubbström (Grubba) <>

Documentation [Cpp]: Added some minimal documentation.


2018-03-21 15:38:18 by Henrik Grubbström (Grubba) <>

Cpp: Let the stack hold the reference to the input string.

Some code cleanup.


2018-03-08 14:56:20 by Henrik Grubbström (Grubba) <>

Cpp: Added C-implementation of a stack.

This class is API-compatible with ADT.Stack, and is intended to be used
by the preprocessor.


2018-03-02 15:22:19 by Henrik Grubbström (Grubba) <>

Cpp: Fixed some issues with #pike.

* cpp_change_compat() leaked stuff on the pike stack.

* Returning non-empty strings from directive_*() functions
should now work.


2018-02-28 17:54:07 by Henrik Grubbström (Grubba) <>

Cpp: Use directive_* function for #pike.

Improves code readability somewhat.


2018-02-27 16:00:22 by Henrik Grubbström (Grubba) <>

Cpp: Use directive_* function for #require.

Fixes support for disabled #require directives. Eg

#if 0
#require stuff

Improves code readability somewhat.


2018-02-26 18:37:47 by Martin Nilsson <>

Remove leftover variable nulling.

2018-02-26 17:57:54 by Martin Nilsson <>

Fixed leak of unknown preprocessor directives.

2018-02-26 17:52:46 by Martin Nilsson <>

Fixed a seriously misleading indentation.


2018-02-24 16:10:42 by Martin Nilsson <>

Remove base_sp from throw_error_object


2018-02-23 16:16:42 by Henrik Grubbström (Grubba) <>

Cpp: Conditional #pragma should now work again.

Fixes "End of file while searching for #endif." when preprocessing
files containing conditional #pragmas. Eg

#if 0
#pragma all_inline
#endif /* 0 */


2018-02-22 16:57:21 by Henrik Grubbström (Grubba) <>

Cpp: Use directive_* function for #pragma.

Improves code readablility somewhat.


2018-02-21 16:48:06 by Henrik Grubbström (Grubba) <>

Preprocessor: Some more cpp() API cleanups.


2018-02-12 22:22:42 by Marcus Comstedt <>

Add more FALLTHRU directives where needed

2018-02-12 21:49:35 by Marcus Comstedt <>

Fix spelling of FALLTHRU directive

The non-standard spelling "FALL_THROUGH" is not recognized by gcc 7.3.
Also, the comment must not contain any other text, or be placed inside


2018-02-03 09:48:55 by Peter Bortas <>

Merge branch '8.1' into peter/travis


2018-01-17 15:12:02 by Henrik Grubbström (Grubba) <>

Cpp: Minor code simplification.


2018-01-15 14:56:05 by Henrik Grubbström (Grubba) <>

Cpp: Use directive_* functions for #error and #warning.

Replace the hard-coded special cases for #error and #warning
with use of the new generic directive_* API. This should make
the code easier to read, and reduces code-duplication somewhat.


2018-01-14 22:11:14 by Henrik Grubbström (Grubba) <>

Cpp: Fixed circular reference issue.

Adding the directive_* functions in the CPP object to the
directives mapping causes circular references. Switch to
looking up the directive functions directly instead.


2018-01-13 12:45:12 by Henrik Grubbström (Grubba) <>

Cpp: Run the preprocessor with the state as current object.


2018-01-12 18:55:45 by Stephen R. van den Berg <>

Restore part of AmigaOS support.

2018-01-12 16:52:01 by Henrik Grubbström (Grubba) <>

Cpp: Added tentative API for custom directives.

Adding a function directive_name() to the CPP class now causes
it to be called by the preprocessor when it encounters the
directive #prefix_name. Most current directives should be possible
to implement using this API, reducing the complexity of low_cpp().

2018-01-12 12:42:47 by Stephen R. van den Berg <>

Rip out final remains of OS2 and AmigaOS.

2018-01-12 12:09:30 by Stephen R. van den Berg <>

Equvivalent and equivalent are not equivalent.

2018-01-12 09:59:40 by Martin Nilsson <>

Small string_builder optimizations.


2018-01-11 23:28:13 by Martin Nilsson <>

We do not support OS/2

2018-01-11 23:24:05 by Martin Nilsson <>

Removed unused variable.

2018-01-11 23:22:03 by Martin Nilsson <>

Trim stack after create.

2018-01-11 13:58:19 by Henrik Grubbström (Grubba) <>

Cpp: Inline preprocessor.h in cpp.cmod.

There's no need for a separate preprocessor template file anymore, as
the template is only included once, so inline it instead to make the
code somewhat easier to follow.


2018-01-10 11:40:34 by Henrik Grubbström (Grubba) <>

Documentation: Added doc for Builtin._take_over_initial_predefines().


2018-01-09 14:41:17 by Henrik Grubbström (Grubba) <>

Cpp: Moved default macro initialization to separate functions.


2018-01-07 11:11:18 by Henrik Grubbström (Grubba) <>

Cpp: Moved initialization of cpp state to create().


2018-01-06 12:29:05 by Henrik Grubbström (Grubba) <>

Cpp: Moved auto_convert flag from argument to state.

This option was passed unmodified through low_cpp() and
apply_define(), and only used in a single place. Moving
it to the cpp state should reduce the overhead somewhat.


2018-01-05 10:19:47 by Henrik Grubbström (Grubba) <>

Cpp: Moved preprocessor state to a proper object.

Cleans up memory and error handling somewhat.


2018-01-04 12:04:50 by Henrik Grubbström (Grubba) <>

Cpp: Fixed potential memory leak on OOM.

add_predefine() would leak the macro name if it failed to
allocate space for the macro value.


2017-11-07 10:48:38 by Martin Nilsson <>

Use wide_isidchar also for non-wide strings.


2017-06-25 01:38:13 by Martin Nilsson <>

A first draft of reduction of object C initializers.


2017-04-08 20:30:39 by Martin Nilsson <>

Use Pike_sp instead of sp


2017-02-08 17:03:29 by Henrik Grubbström (Grubba) <>

Compiler: Moved {null,placeholder}_program to pikecompiler.cmod.

Use the CMOD preprocessor for these programs.


2017-01-25 15:22:32 by Henrik Grubbström (Grubba) <>

Break out sprintf-related stuff from stralloc.h to sprintf.h.

Minor header file cleanup.


2017-01-16 13:34:53 by Henrik Grubbström (Grubba) <>

Compiler: Make #pragma disassemble available --without-debug.


2017-01-10 16:02:00 by Martin Nilsson <>

Changed name from is8bitalnum to isidchar as it contains non-alnum characters (e.g. underscore). Drop 8bit as the wide versions are prefixed as such.

2017-01-10 00:02:49 by Martin Nilsson <>

isalnum doesn't recognize characters in Latin-1 supplement, so replace with is8bitalnum. This only matters for CPP prefixes.


2017-01-08 14:20:37 by Henrik Grubbström (Grubba) <>

Compiler: __ARGS__ is now a macro expanding to __args__.

This ensures that the symbol was reserved in prior versions of Pike,
and also makes it possible to check support via #ifdef.


2016-12-17 13:56:45 by Martin Nilsson <>

Identifiers can no longer contain non-ascii whitespaces. wide_isidchar can now also easily be upgraded to disallow other special characters.

2016-12-17 13:05:44 by Martin Nilsson <>

Removed WC_ISSPACE macro indirection.

2016-12-17 01:53:25 by Martin Nilsson <>

Corrected WIDE_ISSPACE to actually work on all Unicode white spaces.


2016-10-21 10:17:59 by Henrik Grubbström (Grubba) <>

Compiler [cpp]: Fixed some memory leaks.


2016-10-01 11:07:53 by Henrik Grubbström (Grubba) <>

Compiler [cpp]: Reduced code duplication somewhat again.

Join find_end_of_string() and find_end_of_char() into


2016-09-30 13:12:49 by Martin Nilsson <>

Let's not have numbers on string-related defines for other stuff than string width.

2016-09-30 10:44:14 by Henrik Grubbström (Grubba) <>

Compiler [cpp]: Removed unused variable.


2016-09-29 14:11:23 by Henrik Grubbström (Grubba) <>

Compiler [cpp]: Reduced code duplication somewhat.

Add a flags argument to find_end_of_string() and join it
and find_end_of_string2().


2016-09-28 20:09:35 by Martin Nilsson <>

Small simplification.


2016-09-25 18:38:43 by Henrik Grubbström (Grubba) <>

Compiler [cpp]: More code cleanup.

Adds string_builder_append_cpp_quoted_pcharp().


2016-09-24 11:24:23 by Henrik Grubbström (Grubba) <>

Compiler [cpp]: Removed some redundant tests.


2016-09-21 10:23:01 by Henrik Grubbström (Grubba) <>

Compiler [cpp]: Some code clean up.

Adds internal function apply_define().


2016-09-10 10:12:14 by Henrik Grubbström (Grubba) <>

Documentation [cpp]: Fixed warning generated by example.


2016-09-09 16:14:40 by Henrik Grubbström (Grubba) <>

Compiler [cpp]: Fixed refcount bug in simple_add_define().


2016-09-08 12:52:01 by Henrik Grubbström (Grubba) <>

Compiler [cpp]: Renamed field "inside" to "flags".

Also adds CPP_MACRO_* for the valid values.


2016-09-06 10:13:12 by Henrik Grubbström (Grubba) <>

Compiler [cpp]: Changed API for alloc_empty_defile() some more.

It now no longer steals a reference to the macro name.


2016-09-05 22:57:17 by Martin Nilsson <>

Removed some redundancy in adding defines.


2016-09-04 13:56:13 by Henrik Grubbström (Grubba) <>

Compiler [cpp]: Use a pike array to hold the macro parts.

Further preprocessor cleanup.


2016-09-03 09:58:38 by Henrik Grubbström (Grubba) <>

Build [hashtable]: hashtable.[ch] are no longer used.

2016-09-03 09:54:12 by Henrik Grubbström (Grubba) <>

Compiler [cpp]: Replace the struct hash_entry with a string.

The struct hash_entry is only used to hold a string, so get rid
of it and store the string directly instead.


2016-09-02 08:54:49 by Henrik Grubbström (Grubba) <>

Compiler [cpp]: Fixed indentation.

2016-09-02 08:52:08 by Henrik Grubbström (Grubba) <>

Compiler [cpp]: Use the precompiler for the define class.


2016-09-01 12:41:42 by Henrik Grubbström (Grubba) <>

Compiler [cpp]: Renamed struct define to struct define_struct.

This is in preparation to using the precompiler for the define program.


2016-08-31 10:12:43 by Henrik Grubbström (Grubba) <>

Compiler [cpp]: Wrap struct define in objects.

The preprocessor macro lookup table is now a standard mapping instead of
a custom hashtable. This is a step in cleaning up the preprocessor code.


2016-08-30 09:09:22 by Henrik Grubbström (Grubba) <>

Compiler [cpp]: Removed some redundant declarations.


2016-08-24 10:49:17 by Henrik Grubbström (Grubba) <>

Compiler [CPP]: Fixed missing reference.

Potential fix for precompiler failing on some platforms.


2016-08-21 01:29:58 by Martin Nilsson <>

Just use pike_string for args in define magic functions, and get rid of non-generic code.


2016-08-20 11:08:25 by Martin Nilsson <>

binary_findstring_pcharp had one user, so simplify the arguments for both sides.


2016-07-27 10:14:48 by Henrik Grubbström (Grubba) <>

CPP: Use the precompiler to build the preprocessor.

Converts cpp.c into cpp.cmod.

predef::cpp() now uses the precompilers argument checker.