Commit Graph

315 Commits

Author SHA1 Message Date
Nikita Kniazev
7771d20cc7 Fix MSVC C4127 warnings 2019-09-30 01:29:29 +03:00
Nikita Kniazev
75f66ccc0f Suppress bogus MSVC C4428 warning 2019-09-29 01:36:26 +03:00
Nikita Kniazev
db5799558d Fix MSVC C4189 warnings 2019-09-28 19:10:10 +03:00
djowel
16159fb335 add invalid ascii tests + fix 2019-08-26 10:24:20 +08:00
Joel de Guzman
80bb2a9fab Fix for https://github.com/boostorg/spirit/issues/503. Float compariso is tricky. eps for comparision is wrong in some cases. 2019-05-05 03:18:19 +08:00
djowel
949fe02a1f Working fix for https://svn.boost.org/trac10/ticket/11608
Added similar tests to x3
2019-04-25 19:40:40 +08:00
djowel
be7640bd69 Fix for https://github.com/boostorg/spirit/issues/421
WIP: https://svn.boost.org/trac10/ticket/11608
2019-04-25 18:12:45 +08:00
Romain Geissler
295ad6710a Explicitly delete all non implemented assignment operators.
Commit (almost) automatically generated with the following sed command:
sed -i -ne '1h;1!H;${g;s|\n[[:blank:]]*private:\n\([[:blank:]]*\)// silence MSVC warning C4512: assignment operator could not be generated\n\([[:blank:]]*\)\([^\n]\+\);\n|\n\1// silence MSVC warning C4512: assignment operator could not be generated\n\2BOOST_DELETED_FUNCTION(\3);\n|g;p}' $(git ls-files)

Then all files in the x3 subfolder were reverted to HEAD, and manually
updated to use " = delete" instead of BOOST_DELETED_FUNCTION.
2019-04-16 22:35:52 +00:00
Nikita Kniazev
e92f491a54 Qi.Tests: Suppress -Wuninitialized in direct initialization test 2019-03-06 21:10:54 +03:00
Nikita Kniazev
fc39ec12c9 Qi.Tests: rule1: Fixed -Wuninitialized warning
libs/spirit/test/qi/rule1.cpp:75:47: warning: variable 'start' is uninitialized when used within its own initialization [-Wuninitialized]
2019-03-04 00:27:36 +03:00
Nikita Kniazev
0ab06abfc6 Annotate, clean up, and group extended ASCII tests 2019-03-01 22:50:15 +03:00
Nikita Kniazev
ddd4619987 Hexencode extended ASCII characters
There is no other portable way to deal with extended ASCII in source code.
2019-03-01 22:50:15 +03:00
Nikita Kniazev
7b3939f133 Tests: Fix some of maybe uninitialized warnings 2019-03-01 01:12:00 +03:00
Nikita Kniazev
eb8eeb2fbc extract_uint: Fixed IgnoreOverflowDigits=true problem at overflow
The IgnoreOverflowDigits=true parser always succeeds and because of that it
expects from the digits parser that a number passed as inout argument will be
changed only on success.

Changed negative_accumulator and X3 for consistency.
2019-02-22 15:13:02 +03:00
Nikita Kniazev
92596fe02e Fix extract_int test std::pow problems 2019-02-22 04:26:47 +03:00
Nikita Kniazev
4b1b710322 extract_int: Fixed underflow check for (MinOrMax % Base) == 0 2019-02-21 20:21:12 +03:00
Nikita Kniazev
7d3cf1da6d Make extract_int respect std::numeric_limits<T>::digits10 2019-02-21 20:21:12 +03:00
Nikita Kniazev
5ea06d04bd Refactor extract_int test 2019-02-21 02:40:31 +03:00
Nikita Kniazev
0810e33c69 Remove broken 1.0#INF parser
It was poorly documented and never worked correctly. None of atof, strtof, and
input streams are accepting such values. Fixing it would be a bigger breaking
change than removing it.

Fixes #415, addresses #163 and https://svn.boost.org/trac10/ticket/8699
2019-02-10 02:43:40 +03:00
Nikita Kniazev
e46e58f4cd Tests: Added precompiled headers
Not intrusive. Significantly speeds up tests on MSVC (for about 3 times).
Finally solves exceeding build time limits on CI with MSVC compilers.

Did not set up PCH for X3, it is fast as-is (tooks only about 2 minutes).
Repository tests reuse PCH from Qi/Karma tests.
2019-01-21 02:59:45 +03:00
Nikita Kniazev
65157bae07 extract_int: Custom integers support
It will allow to test `extract_int` properly.

Replacing `boost::integer_traits` with `std::numeric_limits` will not hurt
performance because even MSVC 9/GCC 4.1/Clang 3.0 folds `min`/`max` calls
to a constant at compile time and since C++11 they are even constexpr.
2019-01-13 01:12:09 +03:00
Nikita Kniazev
4583a4b708 Boost.System is header only since 1.69 2018-12-30 17:06:19 +03:00
Nikita Kniazev
3fbde9c195 to_utf8: Fixed wchar_t handling on Windows
Spirit were assuming that wchar_t is 32-bit and the content is UCS-4.
It is wrong, the actual representation is implementation defined [lex.ccon]/6.
However, on most Unix platforms this assumption is valid and gives the
expected outcome, but on Windows wchar_t is 16-bit and the content is UTF-16.
2018-10-28 17:43:05 +03:00
Nikita Kniazev
5c62f8baf3 V2: Fixed transform_attribute ambiguity
Domain-agnostic class template partial specializations and
type agnostic domain partial specializations are ambious.
To resolve the ambiguity type agnostic domain partial
specializations are dispatched via intermediate type.
2018-10-22 01:19:27 +03:00
Nikita Kniazev
5e4ab36170 Tests: Include less headers 2018-10-01 02:16:04 +03:00
Nikita Kniazev
b3ae790e2b Use endian macros from Predef
The `boost/detail/endian.hpp` header is deprecated.
2018-09-15 18:19:49 +03:00
Nikita Kniazev
02c3c30077 ts_real_policies: Parse directly into output parameter
There is no need to initialize accumulator with zero value before the first
call to `parse`, and to use a temporary.
2018-03-10 19:22:28 +03:00
Nikita Kniazev
dc9e23e9f5 ts_real_policies: Output parameter is of actual accumulator type 2018-03-10 19:12:28 +03:00
Nikita Kniazev
e472c0536f ts_real_policies: One iterator copy less optimization 2018-03-10 19:09:41 +03:00
Nikita Kniazev
1a72c27306 ts_real_policies: Fixed small numbers parsing
Numbers in range (-1000.0, 1000.0) has only one segment (no thousands delimiter),
and are parsed in `if` statement expression.
2018-03-10 19:06:11 +03:00
Nikita Kniazev
2d2c05c1ae Qi: Mirror char_range boundaries tests from #147 2017-12-26 15:28:14 +03:00
Nikita Kniazev
11a36a0ce2 Remove unused boost/foreach.hpp includes 2017-12-17 20:14:56 +03:00
Nikita Kniazev
602a406c12 Tests: char1: Fixed typo leading to wchar_t to char truncation warning 2017-12-16 22:11:37 +03:00
Joel de Guzman
b10e4a477b
Merge pull request #320 from think-cell/thinkcell_iterator_check
ForwardIterator -> ReadableIteratorConcept & ForwardTraversalConcept
2017-12-11 08:02:09 +08:00
Han Wang
766cc4c9b7 ForwardIterator -> ReadableIteratorConcept & ForwardTraversalConcept
The concept of ForwardIterator is flawed because it mixed 2 sets of concepts (value access and traversal) into 1 package.

http://www.boost.org/doc/libs/1_65_1/libs/iterator/doc/new-iter-concepts.html

It requires value_type (const)& as return type when dereference is applied, which is not mandatory in spirit parsing. A return type which is convertible to value_type is good enough. ReadableIteratorConcept and ForwardTraversalConcept should be what we need for the iterator check.

For example, the iterator of the range returned by boost::adaptors::transform(std::string, func) is normally not a ForwardIterator. But it fulfills ReadableIteratorConcept and ForwardTraversalConcept and should be able to be parsed by spirit.
2017-12-07 17:25:37 +01:00
Nikita Kniazev
3f18a6e99f Qi: Permutations parser always initializes optionals
Closes https://svn.boost.org/trac10/ticket/12473

Optional parser never fails so `attr = val;` always triggers and initializes
the `attr` value. The special case for optional attributes could be safely
removed as any underlying parser must already correctly handle optionals.
2017-12-07 17:59:04 +03:00
Nikita Kniazev
3a2f074c2b Qi.Tests: grammar_fail, rule_fail: Fixed past-the-end pointer problem 2017-12-06 16:05:06 +03:00
Nikita Kniazev
5f93ee81d9 Qi.Tests: rule_fail: Fixed ambiguous symbol 'char_'
..\libs\spirit\test\qi\rule_fail.cpp(28): error C2872: 'char_': ambiguous symbol
boost/spirit/home/support/common_terminals.hpp(235): note: could be 'const boost::spirit::ascii::char_type boost::spirit::ascii::char_'
boost/spirit/home/support/common_terminals.hpp(237): note: or       'const boost::spirit::standard::char_type boost::spirit::standard::char_'
2017-12-06 16:05:06 +03:00
Nikita Kniazev
9fc87a8d21
Merge pull request #297 from think-cell/thinkcell_uint_parser_overflow
fix uint_parser<T(signed)> overflow problem
2017-12-01 13:43:43 +03:00
Nikita Kniazev
80414bc688 fix qi::uint_parser<T(signed)> overflow problem 2017-12-01 03:36:33 +03:00
Nikita Kniazev
0917fca9fd Tests: Improve tests
- Split Spirit v2 tests
  - Readd missing v2 tests
  - Run X3 tests
  - Remove `-p3` suffix
  - Use `<c++-template-depth>`
  - Automatic adding of subproject name prefix
  - Flatten tests declaration
2017-11-28 03:10:20 +03:00
Nikita Kniazev
9c2d6dec93
Revert "Split Spirit v2 tests" 2017-11-26 14:45:39 +03:00
Nikita Kniazev
5e2c3f4f9a Qi.Tests: grammar_fail, rule_fail: Fixed unused variable warnings 2017-11-25 19:01:04 +03:00
Nikita Kniazev
a21b0b33f5 Split Spirit v2 tests 2017-11-25 14:40:54 +03:00
Nikita Kniazev
519f9db94b Qi.Tests: real: Fixed accumulator type 2017-11-21 19:49:37 +03:00
Nikita Kniazev
2f68bc829f Qi.Tests: uint1: Fixed uint8_t usage
Fixes compilation problem on MSVC 8/9
2017-11-15 22:16:23 +03:00
Nikita Kniazev
a0f34f8a34 Qi.Tests: utree1: Fixed operator precedence warnings [clang] 2016-08-27 23:32:52 +03:00
Nikita Kniazev
1ee3b7c18c Qi.Tests: Wrap r1 = r1 | eps with SPIRIT_NO_COMPILE_CHECK macro
Logic of the test is to prevent direct left recursion, but
currently because of it `b2` fails to compile `alternative.cpp`.

I have wrapped the case with `SPIRIT_NO_COMPILE_CHECK` like it
has been done in `char1.cpp` and `sequence.cpp` tests.

Actually the test fails at compilation only with std >= c++11,
but passes with std <= c++03.
2016-08-17 20:50:32 +03:00
mxc-commons
88f494cb0d Fixes for PR #196 expect directive
This PR contains fixes for both issues reported by Lastique and
MarcelRaad. It makes PR #197 obsolete.

Removed obsolete dependency  of test/qi/expectd.cpp on
mxc/qitoo/qitoo.hpp. Was reintroduced by mistake.

Created qi/detail/expectation_failure.hpp. It defines the
expectation_failure template as a common dependency of expect directive
and expect operator. Removed expectation_failure from
operator/expect.hpp.

Changed version.hpp to 2.54. I did not notice that addl file in the
first place.
2016-07-19 16:42:03 +02:00
mxc-commons
aed96ba915 spirit 2 expect directive
Initial commit.
2016-07-07 00:49:18 +02:00