Commit Graph

2382 Commits

Author SHA1 Message Date
David Olsen
e379a7bff6 Update PGI C++ compiler support
Remove a PGI-specific workaround in the functor constructor.  The workaround was necessary several years ago to get class functor to compiler with PGI, but the workaround now causes compilation errors.
2017-07-26 12:52:45 -07:00
Joel de Guzman
1f513cb401 Revert "Crash when print attribute in debug mode." 2017-06-19 17:07:21 +08:00
glacierx
e7962ea67f Update simple_trace.hpp
Crash in debug mode.
2017-06-19 15:42:20 +08:00
glacierx
8c7f9c0711 Update and_predicate.hpp 2017-06-19 15:40:08 +08:00
sehe
ca335f30f4 Fix dangling refs in debug of call_rule_defintion`
There was an issue in `call_rule_definition` where it tries to print the
attribute before transformation (via `context_debug` -> `simple_trace`).

However, it breaks if the made attribute type doesn't match the actual
attribute type. In this case, it makes `context_debug` store a dangling
reference to a temporary converted attribute, leading to Undefined
Behaviour.

See also
https://stackoverflow.com/questions/43679200/boost-spirit-x3-symbol-table-parser-segfaults-when-in-a-separate-compilation-uni/43688320#43688320
2017-04-29 01:07:09 +02:00
Benjamin Buch
cfa7446a87 silence unused parameter warning 2017-02-10 12:27:28 +01:00
sehe
16320a5566 Check for unitialized rules in parser composition
Unitialized rules can silently be aggregated during parser composition,
because of statics across translation units.

get_info<> has been fixed so it doesn't break. As a QoI measure, it also
added a debug assert to help diagnose the situation.

In unary_parser and binary_parser, this commit allows that debug assert
to run as early as possible (typically during program startup) so that
users will notice the initialization ordering problem.

See http://stackoverflow.com/a/41785268/85371 for the
reproducer/analysis.
2017-01-22 01:00:16 +01:00
sehe
6c1cab48fc Avoid logic_error if rule was unitialized
Unitialized rules can silently be aggregated during parser composition,
because of statics across translation units.

Also add a debug assert diagnosing this situation.

See http://stackoverflow.com/a/41785268/85371 for the
reproducer/analysis.
2017-01-22 00:43:19 +01:00
Romain Geissler
1e82fe1ad2 Fix warning "typedef 'iterator_t' locally defined but not used" in classic/error_handling/exceptions.hpp 2016-12-06 11:35:10 +01:00
mike96
e6bd38b615 Add cfloat include to pow10.hpp
Fixes Ticket #12642. The optimized pow10 function would not be used unless cfloat had already been externally included.
2016-12-02 04:13:30 +01:00
Romain Geissler
e1ebac8f00 Fix clang unused paramter warning. 2016-11-18 00:22:40 +01:00
Romain Geissler
dd47d8be67 Fix gcc's warning/error when building with -Wmisleading-indentation 2016-10-16 22:14:51 +02:00
Agustin K-ballo Berge
7859f979d6 Fix assign_to_attribute_from_iterators for long long types
The terminal tags `boost::spirit::[u]long_long_type` hide the integer types `boost::[u]long_long_types`, qualify the later.
2016-10-08 15:36:17 -03:00
Joel de Guzman
192f910c61 Fixes #12468: real_parser failure 2016-09-18 07:49:56 +08:00
Felipe Magno de Almeida
29dc7ec6ea Added BOOST_SPIRIT_NO_REAL_NUMBERS to not include float parsers
This conditional is used to avoid #include'ing traits on floating
point for platforms without floating point, like AVR 8-bit processors.
2016-09-15 23:13:22 -03:00
Felipe Magno de Almeida
30c1d59d35 Make standard_wide and wchar_t optional for platforms that do not support
Added preprocessor conditionals with name
BOOST_SPIRIT_NO_STANDARD_WIDE which can be defined to not use wchar_t.
2016-09-15 23:11:52 -03:00
cppljevans
1d5620fefc Update rule.hpp
As requested here:

https://svn.boost.org/trac/boost/ticket/12366#comment:2
2016-08-25 09:16:25 -05:00
Nikita Kniazev
b2298b8a58 Qi: Fixed missing space in the nested template
The bug was introduced in PR #201
2016-08-18 12:44:12 +03:00
Joel de Guzman
262d5524fb Merge pull request #206 from Kojoley/fix-refers-to-the-current-namespace-warning
Qi: `pow10` is already in the `spirit::traits` namespace
2016-08-18 06:50:56 +08:00
Joel de Guzman
4c5b976633 Merge pull request #201 from mxc-commons/fix_alternative
Fix for spirit_v2 qi/alternative test case
2016-08-18 06:47:38 +08:00
Nikita Kniazev
fa9d2b160d Qi: pow10 is already in the spirit::traits namespace
Fixes the following warning message from the Intel compiler:
> boost/spirit/home/qi/numeric/detail/real_impl.hpp(34): warning #780:
>  using-declaration ignored -- it refers to the current namespace
2016-08-18 01:03:05 +03:00
Nikita Kniazev
ce9814af67 Lex: Fixed unique_ptr usage
Lex is using `unique_ptr` from `movelib` and relying on a bug in it,
described in a ticket https://svn.boost.org/trac/boost/ticket/11758
Since that bug fixed in `movelib`, Lex is uncompilable.

I have simplified unique_ptr usage by the following rules:
  - `delete ptr.release()` is equal to `ptr.reset()`
  - `delete a.release(); a = b;` is equal to `b.swap(a); b.reset();`

Now Lex test suite compiles and runs succesfully. VC++ 6 should be
happy too despite the fact that Boost no longer supports it.
2016-08-15 01:05:21 +03:00
Joel de Guzman
b328180b49 Merge pull request #191 from jefftrull/bugfix/12138
Repair plain_token_range and add tests
2016-08-06 06:19:09 +08:00
mxc-commons
b2a0b2cbb2 Static assert removed. 2016-07-28 04:14:20 +02:00
mxc-commons
ca7952a100 Possible fix for alternative test case 2016-07-28 04:10:55 +02:00
mxc-commons
fade21a0cb Undo header inclusion from PR #197 (obsolete because of PR #198 being merged) 2016-07-23 04:19:36 +02:00
Joel de Guzman
ab18d4e319 Merge pull request #198 from mxc-commons/develop
Fixes for PR #196 expect directive
2016-07-22 13:06:36 +08:00
mxc-commons
3d1274a857 Added missing include for info. 2016-07-19 19:12:17 +02:00
mxc-commons
88871b4ca8 Moved <stdexcept> dependency to expectation_failure.hpp 2016-07-19 17:54:20 +02:00
mxc-commons
330372cb9d Removed inappropriate copyright claim.
Sorry. I was to fast with copy & paste.
2016-07-19 17:43:22 +02:00
mxc-commons
4a7a50dc7d Fix for PR #196 expect directive
Added dependency on qi/detail/expectation_failure.hpp.
Removed dependency on qi/operator/expect.hpp.
2016-07-19 17:01:53 +02: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
Andrey Semashev
785b456e5f Fix missing include for expectation_failure 2016-07-19 16:19:53 +04:00
Joel de Guzman
352ee56d24 Merge pull request #196 from mxc-commons/develop
Expect directive for spirit qi 2
2016-07-16 23:36:50 +08:00
mxc-commons
0d3dc69ca5 Changed type aliases to typedefs for C++03 compatibility 2016-07-15 02:14:44 +02:00
mxc-commons
e399298e7b Adjustments for naming consistency
The qi_expectd.hpp was removed. qi_expect.hpp now forwards to both
directive and operator. Directive doc adjusted to reflect that change.

Lexer.qbk restored to qi develop because change is not part of expect
directive.
2016-07-15 01:11:36 +02:00
mxc-commons
aa01de88d5 Header reordering undo. 2016-07-09 03:19:58 +02:00
mxc-commons
5ba4d68a9b Changed struct expect to struct expect_operator to distinguish from expect_directive.
This change is necessary only to to maintain the independence of order
of header inclusion in qi.hpp.
Without that change, directive.hpp must be included before operator.hpp,
because the expect operator implementation was in a struct named expect
(before this change). This caused a naming conflict with the new expect
directive.
2016-07-09 03:15:58 +02:00
mxc-commons
aed96ba915 spirit 2 expect directive
Initial commit.
2016-07-07 00:49:18 +02:00
Joel de Guzman
379413a50c Fixed bug where string("string1") >> attr(std::string("string2")) produces the wrong attribute result 2016-07-06 22:51:18 +08:00
Joel de Guzman
2759bf97e4 Merge pull request #195 from KayEss/develop
Don't try to declare std::complex for Android builds
2016-06-29 18:39:50 +08:00
Kirit Sælensminde
08b336ddfa Remove undefined behaviour of std::complex declaration. 2016-06-29 17:13:41 +07:00
Kirit Sælensminde
84c97e323d Don't try to declare std::complex for Android builds
This breaks for clang as the NDK namespaces are oddly set up.
2016-06-29 11:04:35 +07:00
Romain Geissler
e361754faf Remove auto_ptr (deprecated in recent C++ standards). 2016-05-31 12:28:25 +02:00
Joel de Guzman
7acc6f2a91 workaround for VX2015 optimization bug 2016-05-19 07:48:21 +08:00
Benjamin Buch
7ecec33021 add const to relational operators of class template multi_pass 2016-05-17 19:46:54 +02:00
Jeff Trull
8ac0d9b98b Fix plain_token_range and add a test for plain tokens 2016-05-16 18:11:02 -07:00
Jeff Trull
b01b402577 Make multi_pass_iterator != operator const and add tests for istream_iterator 2016-05-16 13:36:00 -07:00
Benjamin Buch
124fda5020 fix wrong out commented parameter in x3::detail::make_rule_context(...) 2016-05-13 14:57:32 +02:00
Benjamin Buch
8357037e84 use ignore_unused instead of C-cast to void 2016-05-12 21:35:57 +02:00
Benjamin Buch
a1a30d431b Suppress 'unused parameter' warnings in x3::parse_rule(...) 2016-05-12 21:18:01 +02:00
Benjamin Buch
5c782ee5e7 Suppress 'unused parameter' warnings in x3::detail::make_unique_context(...) 2016-05-12 21:00:03 +02:00
Benjamin Buch
6723910307 Suppress 'unused parameter' warnings in x3::detail::move_if_not_alternative::call(...) 2016-05-12 20:57:25 +02:00
Benjamin Buch
5b1a433d25 Suppress 'unused parameter' warnings in x3::detail::parse_into_container_base_impl::call(...) 2016-05-12 20:53:03 +02:00
Benjamin Buch
10286fafae Suppress 'unused parameter' warnings in x3::detail::call(...) 2016-05-12 20:48:33 +02:00
Benjamin Buch
96272e324f Suppress 'unused parameter' warnings in x3::get_info::operator()(...) 2016-05-12 20:46:33 +02:00
Benjamin Buch
3063a043c7 Suppress 'unused parameter' warnings in x3::lazy_semantic_predicate::parse(...) 2016-05-12 20:42:34 +02:00
Benjamin Buch
ce02014df6 Suppress 'unused parameter' warnings in x3::attr_parser::parse(...) 2016-05-12 20:38:58 +02:00
Benjamin Buch
c3f97a4615 Suppress 'unused parameter' warnings in rule.hpp 2016-05-12 20:35:12 +02:00
Benjamin Buch
277cdf7773 Suppress 'unused parameter' warnings in container_traits.hpp 2016-05-12 20:22:45 +02:00
Deokhwan Kim
a19bcb5b79 Suppress an "unused parameter" warning of rule_
The rule_ parameter is not used in parse_rule, which BOOST_SPIRIT_DEFINE
expands to. GCC with -Wunused-parameter (indirectly activated by -Wall
-Wextra) issues a warning when a function parameter is not used in its
function body.
2016-05-04 15:42:07 -04:00
mgresens
de81dc44dd Using boost TTI library to replace hand-written TTI code. 2016-04-01 13:51:59 +02:00
Joel de Guzman
b818ca5c8d - added x3 variant test
- added x3 variant, extended variant swap member function
2016-03-30 14:06:06 +08:00
Joel de Guzman
76c57b6005 call c.insert(iter, f, l) or c.inser(f, l) as appropriate depending on container type. 2016-03-28 11:56:21 +08:00
hia3
2085a9f509 dangling reference to attribute when BOOST_SPIRIT_X3_DEBUG is defined
dbg_attribute_type(attr_) creates a temporary that is bound to const reference inside of context_debug.
2016-03-26 22:07:13 +03:00
Joel de Guzman
9e488859da Fixes for ticket https://svn.boost.org/trac/boost/ticket/12094 2016-03-26 09:13:16 +08:00
Joel de Guzman
c447315c1c Use forward<T> as appropriate 2016-03-25 07:04:37 +08:00
hia3
a077a4cae4 fixes problem with move_to
Fix bug described here - http://article.gmane.org/gmane.comp.lib.boost.devel/266211
2016-03-19 08:30:23 +03:00
Joel de Guzman
035431b343 Partial fix for ticket 12064: change relative includes using double quotes to a uniform style using angle brackets. 2016-03-13 07:42:52 +08:00
Joel de Guzman
7690022b93 Bigfix: with_context should not return const context. doing so will introduce type conflicts and linker errors 2016-03-11 23:24:41 +08:00
Joel de Guzman
82bd5b2cc1 fixes problem with BOOST_SPIRIT_X3_DEBUG. 2016-03-04 07:01:18 +08:00
Joel de Guzman
d98a7dc9fb Merge pull request #175 from octopus-prime/develop
x3::lit should delegate std::basic_string<Char> instead of Char*
2016-02-25 06:26:29 +08:00
octopus-prime
a39923104d Use std::basic_string<Char> instead of Char* 2016-02-24 21:58:04 +01:00
Joel de Guzman
035fc0fd9d - added static assert on phrase_parse to make sure user does not pass in unused_type skipper
- fixed symbols parser bug (fixes ticket 12016)
2016-02-24 06:29:41 +08:00
Michael Caisse
a4fe5b95af Merge pull request #173 from MarcelRaad/patch-1
Add missing include for mpl::if_
2016-02-23 13:01:48 -08:00
Joel de Guzman
3cee512a4a Merge pull request #170 from octopus-prime/develop
Cleaned up container_traits.
2016-02-22 03:43:31 +08:00
octopus-prime
8602d2b8eb Replaced cend() by end(). 2016-02-21 17:26:37 +01:00
octopus-prime
0037392a73 Changed push_back(unused_type, T const&) to push_back(unused_type, T&&). 2016-02-21 11:47:47 +01:00
Marcel Raad
e4ef5de16f Add missing include for mpl::if_
This caused compile breaks when building Boost.Serialization.
2016-02-18 11:51:36 +01:00
Joel de Guzman
c8ed3fe2e3 Merge pull request #172 from Lastique/patch-1
Add missing includes required in impl/subrule.ipp
2016-02-14 01:26:22 +08:00
Andrey Semashev
a1564f0135 Add missing includes required in impl/subrule.ipp 2016-02-13 19:40:06 +03:00
Andrzej Krzemieński
2edabd2e6f Added header for mpl::if_
without it trying to build quickbook fails for me with an error in MSVC 15.
2016-02-13 14:49:31 +01:00
Joel de Guzman
a8e391bd99 fix sequence partitioning problem 2016-02-04 08:49:53 +08:00
Joel de Guzman
d91cf74106 Fixes Ticket #11952 2016-02-04 08:49:53 +08:00
octopus-prime
9c2bc9f340 size calculation in has_reserve_method case only. 2016-01-30 11:15:33 +01:00
octopus-prime
1fbe050efa Replaced c.end() by c.cend().
Replaced std::integral_constant<bool,
detail::has_reserve_method<Container>::value>() by typename
detail::has_reserve_method<Container>::type{}.
2016-01-28 08:41:14 +01:00
octopus-prime
045216a5c1 Add and use has_reserve_method construct to determine whether container
has reserve() method.
2016-01-27 23:49:55 +01:00
octopus-prime
27d3352ecf Added reserve optimization for std::vector and std::basic_string 2016-01-26 22:30:41 +01:00
octopus-prime
c014a081b2 Cleaned up container_traits. 2016-01-26 21:46:35 +01:00
octopus-prime
c31e79efa8 Using insert() method of containers in push_back(). 2016-01-26 19:23:56 +01:00
octopus-prime
cec9817bc4 Added support for std::multimap, std::unordered_map and
std::unordered_multimap.
2016-01-25 19:50:17 +01:00
Romain Geissler
a52d08d9bf Fix "unused local typedefs" in grammar.ipp 2015-12-16 15:38:26 +01:00
Dmitry Marakasov
f0b6db5b72 Don't forward declare struct tst_pass_through
It is used later in find(), so complete type is needed.
Include tst.hpp which defines it.
2015-11-16 17:12:14 +03:00
Andrey Semashev
a6c79bc35c Silence MSVC warnings
Silence mass MSVC-14 warnings:

boost/spirit/home/support/terminal.hpp(264): warning C4348: 'boost::spirit::terminal<boost::spirit::tag::lit>::result_helper': redefinition of default parameter: parameter 3
boost/spirit/home/support/terminal.hpp(270): note: see declaration of 'boost::spirit::terminal<boost::spirit::tag::lit>::result_helper'
boost/spirit/home/support/common_terminals.hpp(142): note: see reference to class template instantiation 'boost::spirit::terminal<boost::spirit::tag::lit>' being compiled
boost/spirit/home/support/terminal.hpp(264): warning C4348: 'boost::spirit::terminal<boost::spirit::tag::lit>::result_helper': redefinition of default parameter: parameter 4
boost/spirit/home/support/terminal.hpp(270): note: see declaration of 'boost::spirit::terminal<boost::spirit::tag::lit>::result_helper'

and so on for all terminals.
2015-11-15 18:57:33 +03:00
Joel de Guzman
df92cb5c98 ascii char_type is now unsigned to allow 8 bits (reverted from commit 638e4ab54a) 2015-11-10 08:02:58 +08:00
Hartmut Kaiser
509b0891d7 Merge pull request #144 from vtnerd/BugFix_DuplicateAttribute
Fixed bug in karma::duplicate attribute reporting
2015-11-04 20:47:28 -06:00
Joel de Guzman
15bcb67b00 typo fix 2015-11-03 10:02:28 +08:00
Joel de Guzman
638e4ab54a ascii char_type is now unsigned to allow 8 bits 2015-11-03 09:56:14 +08:00
Joel de Guzman
8e0fb1ac22 just to be sure we're not going out of bounds here. 2015-11-03 06:56:24 +08:00
Joel de Guzman
72c8428090 ascii char parsers now fails instead of asserts. 2015-11-02 14:48:54 +08:00
Joel de Guzman
999d031b5d Merge pull request #162 from davidlt/fix-undefined-behavior-load_little_endian-11726
[develop] Fix undefined behavior in ../support/detail/endian/endian.hpp (#11726)
2015-10-20 22:30:12 +08:00
David Abdurachmanov
86705a50af Fix undefined behavior in ../support/detail/endian/endian.hpp (#11726)
Undefined behavior sanitizer (UBSan) with GCC 5.1.1 complains about left
shifting of negative value at run-time. This happens once
boost::spirit::detail::load_little_endian is used with a singed type.

The patch resolves the issue by using unsigned type for making left shifts,
then load_little_endian casts it to specific type T.

Tested with Clang and GCC locally (test case in #11726) and all worked fine.
Tested by running all Boost test cases before and after, no regressions.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
2015-10-19 07:46:57 +00:00
Jürgen Hunold
534cf39f15 Fix: use boost::none global instance instead of constructing it ourselves.
Fixes regression introduce by Boost.Optional in
9f8dd573866a48938d53eab8eade1de41e62a6b1
2015-10-05 10:33:15 +02:00
Joel de Guzman
ee39bf566b Merge pull request #158 from Flast/variadic-fusion
Support variadic fusion.
2015-09-27 20:42:29 +08:00
Romain Geissler
adb0a92f50 Fix "unused locally defined typedef" in parse_tree.hpp 2015-09-23 11:58:14 +02:00
Jürgen Hunold
90027e6a8e Fix: remove extraneous 'typename'
Defect introduced by new code in a4f9ea9d58
2015-09-08 20:53:58 +02:00
Joel de Guzman
cc9d51bd2a Merge pull request #154 from stac47/fix_local_typdef
Fix local typedef definition warning
2015-09-07 19:57:16 +08:00
Laurent Stacul
502f4b9048 Fix local typedef definition warning 2015-09-07 11:16:00 +02:00
tobias-loew
a4f9ea9d58 reenabled support for BOOST_FUSION_ADAPT_ADT adapted structs
since commit 69cc537038 (hkaiser hkaiser
authored on 7 Nov 2009) spirit support BOOST_FUSION_ADAPT_ADT adapted
structs was broken
2015-08-31 10:17:25 +02:00
Adrian Vogelsgesang
7924736c8b X3: set handles_container for expect directive 2015-08-20 00:31:29 +02:00
Sergiu Dotenco
ccb7d5c60d fixed type conversion warnings 2015-08-15 10:16:17 +02:00
Joel de Guzman
299687301a Merge pull request #146 from biocomp/patch-2
Fixing race condition on static init
2015-08-12 16:52:18 +08:00
Artem Tokmakov
d86378252b Updated to use compile-time constants
Tried to minimize included headers (thus no boost::integral_const and constexpr_int). 
Enum won't work for static constant for long long type, when it's not built-in (well, at least this is my understanding).
2015-08-11 00:13:22 -07:00
Adrian Vogelsgesang
a362319f36 X3: fix char_range boundaries
ticket: https://svn.boost.org/trac/boost/ticket/11531
2015-08-09 15:37:48 +02:00
Artem
2ec49b0177 Fixing race condition on static init
Static variables depend on each other and when static init is not thread-safe, this leads to race condition and failures. Ticket: https://svn.boost.org/trac/boost/ticket/11514
2015-08-05 10:48:03 -07:00
Lee Clagett
e16bec0aef Fixed bug in karma::duplicate attribute reporting 2015-07-30 23:30:33 -04:00
Joel de Guzman
5bc397c295 Merge pull request #140 from Lastique/patch-1
Fix signed/unsigned mismatch warning on gcc.
2015-07-27 21:01:34 +08:00
Lee Clagett
e09cc45812 Fixed modifier bug with karma::left_align 2015-07-20 22:57:03 -04:00
Joel de Guzman
9c5dd09880 Merge branch 'master' into develop 2015-07-15 06:38:56 +08:00
Lee Clagett
a18c25b40d Unitialized data fix 2015-07-14 15:44:37 -04:00
Andrey Semashev
eb1a197673 Fix signed/unsigned mismatch warning on gcc. 2015-07-14 10:56:18 +03:00
Andrey Semashev
b61bf56940 Fix signed/unsigned mismatch warning on gcc. 2015-07-14 10:45:36 +03:00
MaksimMyasnikov
12db838af3 https://svn.boost.org/trac/boost/ticket/7161 2015-07-14 01:05:18 +03:00
MaksimMyasnikov
f99fcf76c0 https://svn.boost.org/trac/boost/ticket/9456
https://svn.boost.org/trac/boost/ticket/9457
2015-07-14 00:48:19 +03:00
Joel de Guzman
2df3b8885c Merge pull request #110 from mlang/x3/error_handler.position_of
Allow retrieval of the iterator_range of a position_tagged.
2015-07-09 06:42:57 +08:00
Joel de Guzman
949e499798 Merge pull request #132 from bebuch/develop
return type via decltype(auto)
2015-07-07 08:02:07 +08:00
Mario Lang
b42df6fe50 X3: Fix parse_sequence with variant_attribute. 2015-07-06 23:12:48 +02:00
Benjamin Roland Buch
5dadb838ce return type via decltype(auto) 2015-07-05 17:28:54 +02:00
Benjamin Roland Buch
509029d24a remove include duplicate 2015-07-04 17:10:30 +02:00
Kohei Takahashi
a727400a2e Remove undocumented fusion::void_ usage. 2015-06-30 01:21:26 +09:00
Kohei Takahashi
4d8899fdfe Remove use of deprecated fusion::vectorN. 2015-06-30 01:04:20 +09:00
Mario Lang
9b0daf9cc1 X3: Less is more. 2015-06-26 14:52:59 +02:00
Mario Lang
20ecf739f0 Fix some typos in docs and comments. 2015-06-24 20:45:54 +02:00
Mario Lang
d109f01de9 X3: We do not need integer_sequence.hpp. 2015-06-24 12:20:40 +02:00
Mario Lang
090e7a056e X3: Simplify operator>. 2015-06-23 09:48:51 +02:00
Mario Lang
391cbb2f27 X3: Use decltype instead of result_of.
boost/utility/result_of.hpp is rather expensive to include.
Using decltype here makes the compile time go down by almost half a sec.
2015-06-19 09:49:26 +02:00
Joel de Guzman
c6aba10d55 Merge pull request #124 from mlang/x3/context/decltype-auto
X3: Eliminate two more hidden cases of get_result.
2015-06-19 09:07:21 +08:00
Mario Lang
d6b5f0d925 X3: Eliminate two more hidden cases of get_result.
This is a follow-up to 6ede5f7c81.
2015-06-18 17:19:49 +02:00
Mario Lang
d87aa6846b X3: Add another missing const&.
A tiny change which results in 7kb less binary size and
17.8s to 17.2s compile time reduction (GCC).
2015-06-18 16:00:04 +02:00
Mario Lang
20658b2b21 X3: Remove useless using-directives. 2015-06-17 15:46:50 +02:00
Mario Lang
6ede5f7c81 X3: [context] decltype(auto) makes get_result unnecessary. 2015-06-17 02:06:51 +02:00
Mario Lang
2f20512a3b X3: Make use of implicit constructibility. 2015-06-16 23:46:01 +02:00
Mario Lang
53352198fa X3: Use inheritance instead of typedef typename ...::type type; 2015-06-16 01:23:37 +02:00
Mario Lang
af73c1c209 X3: Simplify alternative::parse. 2015-06-14 19:32:25 +02:00
Mario Lang
1d7159ce0b X3: Avoid copying the arguments to {unary,binary}_parser, sequence and alternative.
For consistency with the rest.  Apparently, this brings the executable size
of an X3 grammar of mine down from 440936 to 420000.  It also reduces
compilation time a bit, which was rather unexpected (18.3s to 17.8s).
2015-06-13 19:31:44 +02:00
Joel de Guzman
a9d7610cab Merge pull request #84 from tabe/develop-set_end
fix unused parameter
2015-06-03 23:24:11 +08:00
Andrzej Krzemieński
7d1bf76803 Removed unused result_t
I get loads of warnings about this unused typedef when building QuickBook.
2015-06-02 17:09:32 +02:00
Mario Lang
bc20650d9e X3: Remove unused include mpl/joint_view.hpp and add mpl/insert_range.hpp where appropriate. 2015-05-31 12:34:40 +02:00
Mario Lang
2a94b18e97 X3: Fix push_back to mpl::view in x3::sequence.
This is a follow-up to 20170960dc which
fixes x3::alternative, but omitted x3::sequence.
2015-05-31 01:12:09 +02:00
Mario Lang
2995de5fa1 Allow retrieval of the iterator_range of a position_tagged.
position_cache allows to retrieve the iterator_range of a
position tagged AST type.  However, pos_cache in error_handler<Iterator>
is private, so the iterator_range can not be retrieved from client code.
It would be useful for a "late raw" and for testing purposes.
This patch adds error_handler<Iterator>::position_of(position_tagged).
2015-05-29 11:10:15 +02:00
Mario Lang
c5b9823ae8 auto makes this simpler. 2015-05-29 02:02:40 +02:00
Joel de Guzman
0a7fadd838 Merge pull request #104 from teajay-fr/feature/x3_binary
Add support for the binary parsers
2015-05-27 14:08:49 +08:00
Thomas Bernard
bec3383191 Remove leftover pragma once 2015-05-26 22:51:55 +02:00
Thomas Bernard
e1210dff47 Clean up and finalized the binary parser 2015-05-24 21:50:38 +02:00
Joel de Guzman
55e87419c7 c++11 coding style tweaks 2015-05-24 22:01:17 +08:00
Joel de Guzman
1c8d9b6e25 removing #pragma once clutter 2015-05-24 16:47:41 +08:00
Thomas Bernard
d5f1197790 Add support for the binary parsers 2015-05-23 15:26:45 +02:00
Mario Lang
ad507e4da1 Fix include paths.
Now the x3 testsuite builds again.
2015-05-22 09:05:47 +02:00
Joel de Guzman
cea20165bf - removing extensions
- promoting stuff from extensions to directive
2015-05-22 08:48:46 +08:00
Mario Lang
10c13779b3 Rename {directive => extensions}/matches.hpp. 2015-05-21 22:25:37 +02:00
Mario Lang
dc4c7f824e x3::matches. 2015-05-21 21:21:31 +02:00
Mario Lang
8bd4d7078d Add one space after 'for'. 2015-05-20 10:49:04 +02:00
Mario Lang
c13b91ac67 X3: No need for BOOST_FOREACH. 2015-05-19 22:21:33 +02:00
Mario Lang
033e52c039 Make annotation.hpp generic and move to support/utility/annotate_on_success.hpp.
Since X3 promotes x3::variant, we can actually make annotation.hpp
generic, avoiding copy-pastism in all the projects that make use of
basic error reporting.
2015-05-18 14:35:52 +02:00
Joel de Guzman
d91a588a78 Bu fix: trac #11313 2015-05-17 20:17:51 +08:00
Mario Lang
7404981b05 Use utf_to_utf in x3::error_handler. 2015-05-17 10:08:08 +02:00
Ahmed Charles
ac70d6f65a Allow rule.hpp to be included independently. 2015-05-16 18:02:10 -06:00
Ahmed Charles
0debda0972 Allow string/string_literal.hpp be able to be independently included. 2015-05-16 14:25:10 -06:00
Joel de Guzman
20170960dc bug fix x3: where we try to push_back to an mpl::view. 2015-05-16 23:59:40 +08:00
Joel de Guzman
c60d93fff3 bug fix for x3 where container attribute is substitute for the container value type. happens with recursive data structures such as vector<v> where v is a variant that also contains vector<v>. 2015-05-16 23:59:40 +08:00
Joel de Guzman
0e17b6d05d reorganizing files into cleaner directory structures 2015-05-15 04:14:07 +08:00
Joel de Guzman
a3d667002f Making testing a full-fledged X3 suppoty utility 2015-05-14 21:38:05 +08:00
Joel de Guzman
c45fdad1b2 Bug fix: rule IDs must have accessible on_error and on_sucess 2015-05-14 21:15:17 +08:00
Joel de Guzman
3627a46902 more test updates and cleanup 2015-05-14 07:40:18 +08:00
Joel de Guzman
0adee06b27 cleaning up the tests 2015-05-14 02:13:24 +08:00
Joel de Guzman
63e779a2e6 added version type 2015-05-12 13:26:51 +08:00
Takeshi Abe
51ab749aae fix another unused local typedef 2015-05-01 14:02:13 +09:00
Joel de Guzman
0956c9f494 Merge pull request #87 from tabe/develop-string_token_def
fix unused local typedef
2015-04-30 17:54:22 +08:00
Takeshi Abe
88086009ba fix unused local typedef 2015-04-30 18:32:56 +09:00
James Widman
21dd555afe Updated the check-for-self in x3::variant 2015-04-29 15:32:13 -04:00
Takeshi Abe
198d1e12e3 comment it out 2015-04-29 18:42:03 +09:00
Takeshi Abe
ab160bf58d fix unused parameter 2015-04-29 12:32:39 +09:00
Sergiu Dotenco
4c92955cf6 fixed level 4 type conversion warning issued by msvc 12.0 2015-04-25 08:37:27 +02:00
Joel de Guzman
b427afa9ee Merge pull request #80 from drivehappy/develop
Removed unused parameters, caught by clang warnings.
2015-04-23 22:23:37 +08:00
Joel de Guzman
52c8dbd6a2 Merge branch 'master' into develop 2015-04-23 08:36:11 +08:00
drivehappy
f703066b45 Re-added commented unused parameters per PR review 2015-04-21 19:09:23 -07:00
drivehappy
6d89b0ac04 Removed unused parameters, caught by clang warnings. 2015-04-21 15:04:14 -07:00
Joel de Guzman
14c87d6168 specific support for puch_back and append to std::map 2015-04-17 07:24:53 +08:00
Joel de Guzman
ac47e3d9cd Fixes for variadic variant updates 2015-04-16 21:49:53 +08:00
Denis Trüby
0eb8830dbd Simplyfied the name of get_line and get_column 2015-04-16 09:01:44 +02:00
Denis Trueby
c0a41f70db Added method to the position_policy to get the current line and column in the output 2015-04-15 22:31:17 +02:00
Nicolas Cornu
1a00f87efa Remove useless typedef to remove warning 2015-04-13 20:57:08 +02:00
Joel de Guzman
c5fe8848ce added explicit force_attribute bool template parameter to rule 2015-04-08 14:34:29 +08:00
Joel de Guzman
5e4b0a7c84 X3 now works with g++4.9 2015-04-08 11:16:32 +08:00
Joel de Guzman
2baddc5f29 fixed new symbols usage 2015-04-08 07:40:50 +08:00
Lauri Nurmi
78afafed86 Fix spelling of "occurr*". 2015-03-29 13:30:24 +03:00
Joel de Guzman
729ffd680a Merge pull request #70 from mlang/error_reporting/without/line_pos_iterator
Decouple error_reporting.hpp from line_pos_iterator.
2014-11-22 01:19:14 +08:00
Mario Lang
c0ea389a1e Fix misplaced inline keyword. 2014-11-18 01:22:56 +01:00
Mario Lang
5d6dd28e84 Decouple error_reporting.hpp from line_pos_iterator. 2014-11-18 01:15:24 +01:00
Mario Lang
19ca8017bd Add missing inline to avoid linker errors about duplicate definitions. 2014-11-18 01:06:15 +01:00
Joel de Guzman
e34a955f2f Major feature adddition!!!: Allow plain rules attributes of the form T,
instead of strictly requiring T().
2014-11-09 17:11:55 +08:00
Joel de Guzman
eb135d77c4 Big negative exponents now fail parsing instead of a runtime assertion. 2014-11-07 20:09:37 +08:00
Joel de Guzman
b7c04a2374 Big exponents now fail parsing instead of a runtime assertion. 2014-11-07 18:23:19 +08:00
Joel de Guzman
6832dc2298 fixing various corner case bugs. the new implementation uses integers
for intermediate computations to improve precision.
2014-11-07 18:23:19 +08:00
Joel de Guzman
c0d6ed357b Fixes Trac #10755 "Wrong overflow checking with uint_parser<uint8_t,
10, 1, 3>"
2014-11-06 08:38:06 +08:00
Thomas Bernard
fec70d409c Merge branch 'x3-devel' into feature/x3_devlop_merge
Conflicts:
	include/boost/spirit/home/x3/extensions/repeat.hpp
	test/x3/Jamfile

Add support for no_case to the bool parsers
2014-11-01 23:43:02 +01:00
Baptiste Wicht
9113f02e5d Macro to remove filesystem dependency
This patch adds the BOOST_SPIRIT_X3_NO_FILESYSTEM macro which removes the dependency on boost filesystem when enabled. 

There is only one line in X3 that depends on filesystem, so I think that it is a good feature to let the user disable it if it doesn't want the dependency.
2014-11-01 14:39:17 +01:00
Kohei Takahashi
83b8adbb7a Compliant fusion::result_of::make_map changes with variadic map.
Signed-off-by: Kohei Takahashi <flast@flast.jp>
2014-10-26 17:48:00 +09:00
Joel de Guzman
d9678d5d50 Merge pull request #62 from vtnerd/BugFix-NullTermination
Fixed bug with null-termination and string containers.
2014-10-19 12:48:58 +08:00
Lee Clagett
726a930dc6 Fixed bug with null-termination and string containers. 2014-10-18 23:56:15 -04:00
Thomas Bernard
6c0b5da3a5 Improved the formating 2014-10-18 10:24:01 +02:00
Thomas Bernard
e4d195ef29 Merge branch 'x3-devel' of https://github.com/boostorg/spirit into feature/x3_no_case
Conflicts:
	include/boost/spirit/home/x3/string/literal_string.hpp

Finalized the no_case handling based on the corrected encoding handling
2014-10-18 10:15:49 +02:00
Thomas Bernard
92bd34bd79 Corrected the seperation of the literal string from their sizes in the
any_char operator()
Reactivated all the char set tests
2014-10-15 23:00:58 +00:00
Thomas Bernard
7bde4c42ff Add as_parser templates to handle on char strings as char_ instead of
literal_string
2014-10-13 09:30:41 +00:00
Thomas Bernard
134e30e750 Add support for char sets and char ranges 2014-10-13 09:30:25 +00:00
Stephan Aiche
60464482ee check for fist == last before dereferencing first 2014-10-13 10:08:44 +02:00
Thomas Bernard
a4e043101c Add the char_set and char_range parser 2014-10-12 17:16:07 +00:00
Thomas Bernard
eec3ff5316 Fix the char encoding specific generators for all the string literal
parsers
2014-10-12 15:57:55 +00:00
Thomas Bernard
1d62676106 Simplified the case sensitive/insensitive helpers 2014-10-12 14:24:53 +00:00
Thomas Bernard
60cca11616 Implement the no case directive for the symbols parser 2014-10-12 14:10:03 +00:00
Thomas Bernard
ad9d0429a0 Use a less invasive case_compare type extraction from the context 2014-10-07 23:19:36 +00:00
Thomas Bernard
3f089ad131 Create a fresh no_case context for the skipper 2014-10-06 23:10:09 +00:00
Thomas Bernard
430cd5feec Add missing template keyword for clang 2014-10-06 23:09:37 +00:00
Thomas Bernard
ea72c747af Make the char class parser no_case compatible.
Make all no_case tests pass.
2014-10-05 23:26:19 +00:00
Thomas Bernard
1f01e90564 Use the same logic as the skipper to swap between case sensitive and
case insensitive parsing.
2014-10-04 23:24:20 +00:00
Thomas Bernard
c0dfd14169 Move the no case tag and the context extraction template to the support
folder
2014-09-24 22:39:13 +00:00
Thomas Bernard
4b1fab071d Make no case directive compilable
Added helpers to parse no case strings
Fixed some include locks
Do not pass the encoding as runtime parameter to the parsing helpers
2014-09-21 22:41:22 +00:00
Thomas Bernard
5a74952057 Add no case directive 2014-09-09 22:26:41 +00:00
Maks Naumov
306f59b3af Add the missing comparison for 'goto_state' 2014-08-23 18:40:04 +03:00
Joel de Guzman
c87d350bb6 small tweaks 2014-08-11 18:13:27 +08:00
Joel de Guzman
5b5ccf2e49 fixes Ticket #10193 2014-08-11 17:52:24 +08:00
Sergiu Dotenco
60f53babe5 suppress msvc 'conditional expression is constant' warnings 2014-08-04 14:34:30 +02:00
Thomas Bernard
ee69de777c Fix the namespace of the karma proto domain 2014-07-21 22:35:47 +00:00
Joel de Guzman
c480d6c7fc workaround for lexertl bug on platforms where wchar_t is signed (can be negative). 2014-07-19 08:12:53 +08:00
K-ballo
7fa39377bb Merge remote-tracking branch 'remotes/origin/master' into develop 2014-07-16 23:35:25 -03:00
K-ballo
e6aadc7622 Cast anonymous enum to avoid instantiating Boost.Range operators 2014-07-09 21:33:39 -03:00
Joel de Guzman
bcd6f561ad Merge branch 'develop' 2014-07-10 08:07:16 +08:00
Agustín Bergé
239ff77b0d Merge pull request #44 from MarcelRaad/fix-msvc
Fix compilation with MSVC 12+
2014-07-06 23:12:44 -03:00
Joel de Guzman
0b6c62e7ef Merge pull request #45 from MarcelRaad/fix-warnings
Fix MSVC compiler warnings
2014-07-06 05:42:48 +08:00
Marcel Raad
3fb27f9ce4 Fix MSVC compiler warnings 2014-07-05 19:43:16 +02:00
Marcel Raad
51e095fa54 Fix compilation with MSVC 12+ 2014-07-05 19:40:54 +02:00
Marcel Raad
0baa99aff5 Add missing includes 2014-07-05 19:38:19 +02:00
Tomoki Imai
67b3097895 Fix line_pos_iterator's column counting bug,get_current_line bug.
Add regresssion test for it.
2014-06-14 17:28:09 +09:00
cppljevans
fb8160bb59 Fix misleading output from context_debug due to swapping instead of copying. 2014-06-11 09:06:50 -05:00
K-ballo
d912186426 Revert "Merge pull request #37 from cppljevans/context_debug_fix_swap"
This reverts commit 527e54b549, reversing
changes made to 3928caeb3d.
2014-06-08 22:44:29 -03:00
Joel de Guzman
527e54b549 Merge pull request #37 from cppljevans/context_debug_fix_swap
Context debug fix swap
2014-06-09 06:15:20 +08:00
cppljevans
b1cdd15f53 fix context_debug use in detail/rule.hpp 2014-06-08 13:50:54 -05:00
Joel de Guzman
e95d80d682 added bool.cpp test 2014-06-07 08:23:32 +08:00
Joel de Guzman
4d1c9e5af7 Merge branch 'origin/develop' 2014-06-07 07:47:45 +08:00
Joel de Guzman
132da2f01a Merge branch 'spirit_x3' 2014-06-07 07:47:01 +08:00
Joel de Guzman
8cd6940866 added bool parser 2014-06-07 07:46:18 +08:00
Joel de Guzman
97ddf141e3 - Added calc 9 (ported from Qi calc 8).
- Fixed is_substitute for variants
- Fixed variant_find_substitute when Attribute and Variant is the same type
2014-06-06 23:35:09 +08:00
Joel de Guzman
97ca172485 preparing for calc9 2014-06-06 12:10:27 +08:00
Joel de Guzman
2a735d84fe Merge branch 'temp' 2014-06-06 08:17:21 +08:00
Seth Heeren
de562e75ee Fix assignment basic_hold_any::operator= #35 (c++11)
The template version would not be used because the compiler-generated
one was a closer match. The implicit assignment, however, broke the
ownership semantics.
2014-06-06 02:12:02 +02:00
Joel de Guzman
dd80c84a05 Merge branch 'master' 2014-06-06 07:05:34 +08:00
Joel de Guzman
3928caeb3d Merge branch 'origin/master' 2014-06-06 07:03:33 +08:00
Joel de Guzman
ce24248d8f adding testing utility 2014-06-06 07:02:35 +08:00
Seth Heeren
637bc77505 Fix assignment basic_hold_any::operator=
The template version would not be used because the compiler-generated
one was a closer match. The implicit assignment, however, broke the
ownership semantics.
2014-06-06 00:50:29 +02:00
K-ballo
a6c314fdb4 Cosmetic fixes to the repeat directive 2014-06-01 22:31:34 -03:00
Lee Clagett
6825a6716f Ported confix to x3 extensions 2014-06-01 20:44:16 -04:00
Joel de Guzman
0f5844c525 Merge pull request #32 from vtnerd/bugfix/raw-handles-container
Bugfix/raw handles container
2014-05-31 13:32:18 +08:00
Joel de Guzman
409059dc43 Bumped spirit version 2014-05-31 13:07:24 +08:00
Lee Clagett
375ab999ed Changed the handles_container attribute of raw to always return true
The raw directive currently defers the decision of whether it can handle
a container to its subject (handles_container). If the subject cannot
handle a container, the raw directive returns false too. Since
is_container returns true for iterator_range, this creates problems with
the sequence operator that tries to call
attr.insert(attr.end(), raw_range) when handles_container of the raw
subject is false. Since the raw directive can handle container
attributes (it has for some time), it seemed best to always return true
for handles_container.
2014-05-30 08:38:59 -04:00
Joel de Guzman
29ead94468 Merge branch 'x3-devel' 2014-05-30 13:37:31 +08:00
Joel de Guzman
41cf0f5fdb minor adjustments. we're good to go. test pass. 2014-05-30 13:34:25 +08:00
Joel de Guzman
3afadd48dc Merge pull request #28 from teajay-fr/feature/x3_repeat
Feature/x3 repeat
2014-05-30 13:26:32 +08:00
Joel de Guzman
3ac97a6e33 Merge branch 'develop' 2014-05-28 16:08:58 +08:00
Joel de Guzman
e85cf3da3f fixed long standing operator precendence bug 2014-05-28 15:45:26 +08:00
Joel de Guzman
a70a53e856 Merge branch 'x3-devel' 2014-05-27 13:22:18 +08:00
Joel de Guzman
64e4fe1511 simpler name for bool template param 2014-05-27 06:21:09 +08:00
Joel de Guzman
fb2ab52da1 merging position_cache with error_handler 2014-05-26 20:00:45 +08:00
Joel de Guzman
faebc75274 compiler error handling looking good 2014-05-26 19:32:56 +08:00
Joel de Guzman
99430b8077 simplification of semantic action interface
- there are only 2 variations now f() and f(ctx)
  - added _attr(ctx) accessor for accessing the attribute
  - added _where(ctx) accessor for accessing the iterator range
this, and in preparation for a unified call interface for actions as well as lazy args to e.g. eps(f)
2014-05-26 17:03:26 +08:00
Joel de Guzman
b00adde370 using is_callable utility instead of proto hack 2014-05-26 14:14:30 +08:00
Joel de Guzman
528c1de366 made on_success mechanism as a member of the rule ID 2014-05-26 13:06:58 +08:00
Joel de Guzman
168e202365 making the rule ID more useful by making it a class where you define on_error (and later on_success) hooks. 2014-05-26 12:38:30 +08:00
Joel de Guzman
913a092ee6 reverting previous mistakes 2014-05-25 08:29:56 +08:00
Joel de Guzman
275b0bcb34 some cleanup 2014-05-24 17:29:09 +08:00
Joel de Guzman
683ed7df49 improved exception handling API: on_error(first, last, x, context) 2014-05-24 16:45:46 +08:00
Joel de Guzman
41b5b4b1a6 implemented clang-style error handling 2014-05-24 16:32:23 +08:00
Joel de Guzman
8ca164044c - added lambda_visitor
- added annotation of ASTs
2014-05-19 11:53:25 +08:00
Joel de Guzman
caf19f5c7c passing position_cache as context to our parser (for error handling) 2014-05-19 10:34:16 +08:00
Joel de Guzman
0a32d104db incremental port again 2014-05-19 02:46:48 +08:00
Joel de Guzman
92b4f69c74 another incremental port of qi::calc7 2014-05-18 07:27:29 +08:00
Joel de Guzman
fe2a3e13bb bumping copyright dates 2014-05-17 17:41:20 +08:00
Joel de Guzman
2610912397 added phrase_parse_context 2014-05-17 11:56:34 +08:00
Joel de Guzman
fd99b74257 Implemented BOOST_SPIRIT_DECLARE and BOOST_SPIRIT_DECLARE 2014-05-17 10:46:07 +08:00
Joel de Guzman
1a960e4bba All tests are now passing. 2014-05-17 09:25:06 +08:00
Joel de Guzman
12ee452e27 - allow simple local rules
- inject the rule tag into the context ONLY IF there's no BOOST_DEFINE for that rule.
2014-05-17 08:24:52 +08:00
Joel de Guzman
1966f55985 working with the monster 2014-05-16 13:34:25 +08:00
Joel de Guzman
927dea5eb1 implementing BOOST_SPIRIT_DEFINE 2014-05-16 07:22:18 +08:00
Joel de Guzman
0e47e08037 added rcontext argument to parse functions 2014-05-15 21:46:25 +08:00
Joel de Guzman
aeb0e93865 fix for raw directive 2014-05-13 09:37:14 +08:00
Lee Clagett
3f0ec43f53 Modifying x3 seek implementation for better readability 2014-05-10 15:19:23 -04:00
Thomas Bernard
6dfba300b8 Don't use lambdas for the repeat limit evaluation
Comment out the not yet supported tests
Changed some variable names to improve the code clarity
2014-05-09 01:21:53 +02:00
Joel de Guzman
ba9239aa2e Merge branch 'origin/develop' 2014-05-08 07:41:02 +08:00
Andrey Semashev
c82c039f43 Fix compilation with C++03 compilers.
Fix compilation with C++03 compilers (e.g. gcc 4.2.1).
2014-05-07 22:30:24 +04:00
Thomas Bernard
e1571dac5e Remove old code 2014-05-07 16:50:41 +02:00
Thomas Bernard
a5e1c57350 Add repeat directive 2014-05-07 16:43:12 +02:00