Releases: ned14/pcpp
v1.30
v1.30 (29th October 2021):
- Thanks to a 5km limit covid lockdown in my country, a public holiday where we were
supposed to be away meant I was stuck at home instead. I took the full day to finish
the https://github.com/ned14/pcpp/tree/yacc_expression_evaluator branch which is a
proper C preprocessor expression evaluator based on http://www.dabeaz.com/ply/ 's
yacc module. This was a very long outstanding piece of work which had been in
progress for nearly two years. It just needed a full day of my time to get it done,
and now it is indeed done at long last. - BREAKING CHANGE: Thanks to the new expression evaluator, fix a long standing bug
where unknown function macros in expressions were parsed as0(0)
which obviously
enough does not work. Fixing this changes how theon_unknown_macro_in_expr()
hook works, and there is now an addedon_unknown_macro_function_in_expr()
hook. - Add a new passthru option
--passthru-includes
which enables selected#include
to be passed through, in addition to being executed. Thanks to schra for suggesting
this, including a PR. The original implementation had some subtle corner case bugs,
thanks to trelau for reporting those. - Fix a token expansion ordering bug whereby if a function macro used the same
macro in more than one argument, expansion in one argument evaluation caused overly
eager expansion in later argument evaluations. This fix ought to fix pcpp's ability
to parse Boost (untested). Thanks to joaquintides for reporting this. - Now that pcpp no longer ever calls
eval()
, pcpp is PyPy compatible and is
probably also compatible with Pyston (untested). Typical speedup is about 2.2x-2.3x,
though it can also be slower occasionally for some inputs. PyPy compatibility is now
being tested by CI to ensure it remains working going forth. - Fix internal preprocessor error and failure to insert newlines before
#include
caused by certain sequence of line continuations in a macro. Thanks to dslijepcevic
for reporting this.
v1.22
v1.22 (19th October 2020):
- Fix bug where outputting to stdout did not combine with anything which
printed to stdout. Thanks to Fondesa for reporting this. - Fix extra newlines being inserted after a multiline comment. Thanks to virtuald
for sending a PR fixing this. - Fix not being able to actually specify an empty line directive. Thanks to kuri65536
for sending a PR fixing this. - Update ply submodule to latest from trunk.
- Emit line continuations as tokens, rather than collapsing lines during parsing.
Thanks to MathieuDuponchelle for the pull request implementing this. - Enable parsing and emission of files in arbitrary text encodings. This is supported
in Python 3 or later only. Thanks to MathieuDuponchelle for the suggestion. - Fix bad regex for parsing floats, so now floats are correctly tokenised. Thanks
to LynnKirby for reporting this. - BREAKING CHANGE: Passthrough for
#include MACRO
was not supported. This was not
intentional, and to fix it required modifying theon_include_not_found()
customisation point which is a source breaking change. Thanks to schra for reporting this.
v1.21
v1.21 (30th September 2019):
-
Fix bug where token pasting two numeric tokens did not yield a numeric token. Thanks
to Sei-Lisa for reporting this. -
BREAKING CHANGE: Paths emitted by pcpp into
#line
directives now are relative to the
working directory of the process whenPreprocessor
is initialised. This includes
added search paths - files included from those locations will be emitted with a sequence
of../
to relativise the path emitted. If no path exists between the working
directory and the path of the file being emitted, an absolute path is emitted instead.If you wish to disable this new behaviour, or use different behaviour, you can
customise the newrewrite_paths
member variable ofPreprocessor
. -
Fix bug where
__LINE__
was expanding into the line number of its definition instead
of its use. Thanks to Sei-Lisa for reporting this. -
Add
--passthru-magic-macros
command line option. -
BREAKING CHANGE: The
PreprocessorHooks
andOutputDirective
interface has
changed. One now must specify the kind ofOutputDirective
abort one wants, and one
can now both ignore AND remove directives.on_directive_handle()
and
on_directive_unknown()
now take an extra parameterprecedingtoks
, these are the
tokens from the#
up to the directive. -
Fix a corner case where
FUNC(void)foo()
expanded tovoidfoo()
and not
void foo()
which is a very common non-conforming extension of the C preprocessor.
Thanks to OmegaDoom for reporting this. -
Add tokens for all the C operators, to help implementation of an expression evaluator.
-
Updated embedded ply to HEAD (2019-04-25)
-
Fix
#include
not working if no-I
parameters were supplied. Thanks to csm10495
for reporting this.
v1.20
v1.20 (7th January 2019):
- Now supports character literals in expressions. Thanks to untaugh for the pull request
adding this. - Stopped the default collapsing of whitespace in output, and made it optional via a
new command line option--compress
. - Fixed extraneous whitespace in
--passthru-comments
caused by multiline comments.
Thanks to p2k for reporting this. - Fixed bug where defining a macro via string did not set the source attribute in the
token. Thanks to ZedThree for reporting this. - Stop triggering an exception when no arguments are supplied to pcpp. Thanks to
virtuald for reporting this. - Rebase onto PLY latest from Dec 28th 2018 (dabeaz/ply@a37e083). Latest
PLY no longer works using pypi packaging, David wants people to include the source of
PLY directly. pcpp does this via a git submodule, and has setuptools bundle the submodule. - Add a formal LICENSE.txt file, as requested by Sei-Lisa.
- Fix failure to issue
#line
directive for first include file in a file. Thanks to
Sei-Lisa for reporting this.