2
0
mirror of https://github.com/boostorg/spirit.git synced 2026-01-19 04:42:11 +00:00

1057 Commits

Author SHA1 Message Date
Nikita Kniazev
660d8ac3c1 X3.Tests: Fix odd temporary attribute creation 2019-02-26 21:23:43 +03:00
Nikita Kniazev
793d89619c X3: Move only types with optional 2019-02-26 21:23:43 +03:00
Nikita Kniazev
8bd9b6ece4 X3: Fixed container of move only types with sequence 2019-02-26 21:23:43 +03:00
Nikita Kniazev
f371ccf6d0 X3: push_back has to forward actual reference type
Added tests for move only types in kleene, plus, list, and repeat parsers
2019-02-26 21:23:43 +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
b5f1552ec2 X3: Perform attribute transformation before calling parse_rule
This will deal with linking problems when rule attribute type is not the same
as the actual attribute type. It will not harm anyone as the transformation
after parse_rule will just pass-through the attribute because it will be the
same there. It will also do not alter rule_definition parsing so other usages
are still valid.
2019-02-08 21:55:11 +03:00
Nikita Kniazev
afe763b61e X3: Fixed static assert on parse_rule instantiation
During overload resolution disallowed signature can be instantiated leading
to firing the static assertation and overload resolution failure. I could
just remove it, but do not want to leave unbounded by value overloads;
replacing to not deducing Attribute with specifying a default parameter will
not work because we want to allow `BOOST_SPIRIT_DECLARE` without prior
`BOOST_SPIRIT_DEFINE` - this requires having default parameters in both
declaration and definition and the standard seems to forbid it (GCC - fine,
MSVC - warning, Clang - error).

Reverts #437, fixes #453.
2019-02-08 14:51:35 +03:00
Nikita Kniazev
5663d7d39d X3: Added tests for non-movable and non default constructible types 2019-02-07 14:57:45 +03:00
Nikita Kniazev
c915ac4170 X3: rule: Skip attribute synthesization on unused actual attribute
There is a mistake in `make_attribute` trait that leads to synthesization and
immediately throwing out an attribue, so rule context always was unused_type
when actual attribute is unused_type (added test for this case). Instead of
fixing `make_attribute` trait I just completely removed synthesization in
rule by removing `make_attribute` trait usage (the traits could be removed
after a simple change in 'action' parser). I think the change is better
than fixing the trait because it removes excessive attribute default
construction in every rule and makes rule almost free to use.
2019-02-06 16:42:07 +03:00
Nikita Kniazev
a0e5817444 Revert to use <dependency> feature
This was my fault when I did not mark subfeature `propogated` and after fixing
it I did not retest this thing.
2019-01-27 16:52:47 +03:00
Nikita Kniazev
9293cbee5e X3.Tests: Added some rule attribute advertising tests 2019-01-26 17:32:04 +03:00
Nikita Kniazev
a3cf3f2c3e X3: Fixed wrong parse_rule signature instantiation
When a rule has no attribute (leaves `Attribute` template parameter as default)
the `BOOST_SPIRIT_INSTANTIATE` macro instantiates a `parse_rule` helper function
with a wrong signature because `parse`, `phrase_parse`, and `skip_over` pass as
the attribute `unused` variable which deduces to `unused_type const&` type, but
`BOOST_SPIRIT_INSTANTIATE` instantiates `parse_rule` with `unused_type&` type.
2019-01-26 17:32:04 +03:00
Nikita Kniazev
ab280528a3 Merge pull request #439 from Kojoley/x3-remove-sequence-to-plain
X3:  Removed sequence into plain parsing
2019-01-21 14:23:49 +03:00
Nikita Kniazev
d80d32f892 X3: Removed sequence into plain parsing
The possibility to parse `int_ >> int_` into `int` is dangerous and hides the
actual bugs in user parsers (and in Spirit too).
2019-01-21 03:06:53 +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
a36077efbd X3.Tests: extract_int: Workaround GCC < 7 bug
[GCC prior to 7 version][1] does not implement [CWG 374][2] which is C++11.

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
[2]: http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#374
2019-01-13 23:03:26 +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
1f24a5a04b X3.Tests: Removed Phoenix includes 2018-12-31 03:14:10 +03:00
Nikita Kniazev
c6d5c9c3d9 X3.Tests: Removed unused using declarations 2018-12-31 00:05:26 +03:00
Nikita Kniazev
4583a4b708 Boost.System is header only since 1.69 2018-12-30 17:06:19 +03:00
Nikita Kniazev
e07ce69363 Removed unused lexical_cast includes 2018-12-27 19:36:51 +03:00
Nikita Kniazev
865a6a3de4 X3.Tests: Added variable templates requirement
Also updated the readme, as Clang 3.5 does not support variable templates
(it also has some bogus warnings and broken Fusion map support).
2018-11-26 18:39:01 +03:00
Nikita Kniazev
304a10ff33 Karma.Tests: real.hpp: Fixed typo in comments
https://svn.boost.org/trac10/ticket/8440
2018-11-22 18:27:58 +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
1d9aa696bf Karma: Fixed use after scope bug if ADT getter returns by value
The `extract_from_attribute` returns a reference to a temporary
value produced by calling Fusion ADT adapted sequence getter that
returns by value.

Was reported 6 years ago https://svn.boost.org/trac10/ticket/6126
2018-03-15 18:50:17 +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
fac9dfae9e X3: Pass container attribute through sequence 2018-02-28 23:21:31 +03:00
Nikita Kniazev
49587ff7a0 Merge pull request #340 from Kojoley/x3-deref-view-instead-of-unwrap-seq
X3: Dereference a single item view instead of unwrapping sequence
2017-12-30 02:50:03 +03:00
Nikita Kniazev
0887e25568 X3: Check passed attribute type 2017-12-29 20:44:36 +03:00
Nikita Kniazev
ddcdafbe95 Merge pull request #344 from Kojoley/tests-lex-token_moretypes-use-optional
Lex.Tests: token_moretypes: Use optional
2017-12-27 19:08:13 +03:00
Nikita Kniazev
160dee1799 Do not use extended initializer lists 2017-12-26 16:25:54 +03:00
Nikita Kniazev
2d2c05c1ae Qi: Mirror char_range boundaries tests from #147 2017-12-26 15:28:14 +03:00
Nikita Kniazev
a9eab0ef78 Lex.Tests: token_moretypes: Use optional
Simplifies values declaration and fixes warnings.
2017-12-26 15:27:34 +03:00
Nikita Kniazev
3ae9e29184 Merge pull request #152 from vogelsgesang/fix_expect_container_parsing
X3: Fix expect directive's handling of container attributes
2017-12-23 03:12:39 +03:00
Nikita Kniazev
72c049499f X3: Return back omit tests 2017-12-22 02:10:02 +03:00
Nikita Kniazev
9bdbf6bd2b X3: Fixed iterator move_to to single item sequence
This affects lazy attribute constructing parsers, which exposes not an actual
attribute, but a pair of iterators (like `string` or `attr("...")`).
2017-12-21 01:55:51 +03:00
Nikita Kniazev
fa771b62d6 Merge pull request #330 from Kojoley/x3-reenable-fusion_map-support
X3: Reenable fusion::map support
2017-12-18 18:51:48 +03:00
Nikita Kniazev
62d604603c Merge pull request #331 from Kojoley/boost-foreach
Remove unused `boost/foreach.hpp` includes
2017-12-18 18:51:32 +03:00
Nikita Kniazev
7fdc4d2460 Merge pull request #333 from Kojoley/fix-karma-binary2-overflow
Karma.Tests: Fixed overflow in binary tests
2017-12-18 18:51:02 +03:00