Integers with digit separators are already recognized as literal
tokens. This commit adds proper interpretation of them as integers for
use in expressions e.g. with #if
- Fix RE2C code for numbers (binary and digit separators)
- Revert to RE2C version 1.0.2, for now
- Revamp token ids to minimize changes
- Restore existing and more accurate name OPTSIGN in slex
- Add binary literal support to lexertl
- Fix xlex support for size_t literals
- Add test tokens for octal, binary, and hex literals
* fix segment fault of empty stringify under C++20
* Add tests for optional comma in variadic macro call
---------
Co-authored-by: Jeff Trull <edaskel@att.net>
* Make the library modular usable.
* Switch to library requirements instead of source. As source puts extra source in install targets.
* Add wave tool build to all target.
* Add missing NO_LIB usage requirements.
* Add requires-b2 check to top-level build file.
* Bump B2 require to 5.2
* Change all <source> references to <library>.
* Move inter-lib dependencies to a project variable and into the build targets.
* Update build deps.
To test against different compiler versions we use older Docker
images, which in turn have different glibc versions. Github recently
deprecated Node version 16, which had been built with an older glibc
version, and the newer Node version requires a glibc version that is
not available on the old images, causing builds to fail.
This is a hack permitting the continued use of Node 16, until Github
decides to make it impossible.
The previous code checked for signed overflow on +, -, and * by doing
the operation and checking the result, which can invoke undefined
behavior. This replaces that code with initial tests on the operands.
In addition, a test for the sole integer division overflow case (that
is not division by zero) was missing: INT_MIN / -1
It has now been added, along with a test case.
* Update marker before and after fill() operation in cpplexer
* A basic test case for trigraph "pound" (octothorpe) on fill boundary (detects the marker issue)
This change resolves#202
---------
Co-authored-by: Chris Chisolm <chris_chisolm@intuit.com>
Co-authored-by: Jeff Trull <edaskel@att.net>
* Check for backslash characters before the start of the new data
With BOOST_WAVE_BSIZE set to 40, test t_5_002 fails because a newline appears exactly at the beginning of a newly
fetched buffer, and a backslash is at the end of the previous one. In that case the escaped newline
was not detected. This change will also consider three unprocessed bytes of input data, if available,
prior to the new data, which is enough to detect a trigraph backslash.
* Improve data range check for backslash newline
The existing check considered the space required for a trigraph backslash, but not for the following LF (or CRLF) before testing for them. With BOOST_WAVE_BSIZE set to 98 this caused a segfault in t_5_001.
There is no guarantee (indeed, it is unlikely) that data within the
scanner buffer will be null terminated, and so the constructor that
accepts a pointer and a count is appropriate.
This will be for Boost 1.84 forward. The new replacements were
available previously, so for some versions before 1.84 we'll still see
deprecation warnings if users mix versions of Boost and Wave.