Joel de Guzman
2a6e8f73ed
Merge pull request #284 from Kojoley/fix-subrule-use-after-scope
...
subrule: Fixed a huge use after scope bug
2017-11-22 07:26:42 +08:00
Nikita Kniazev
f67fcd0e95
Fixed nested comment is not allowed
warning from intel compiler
2017-11-21 19:49:38 +03:00
Nikita Kniazev
fdb56edbc8
Classic: Fixed forcing value to bool warning
...
The warning even removed from MSVC 2017
2017-11-21 19:49:37 +03:00
Nikita Kniazev
4e700fe285
Qi: stream: Fixed truncation warning
2017-11-21 19:49:37 +03:00
Nikita Kniazev
d3cc71002c
Fixed redundant semicolons
2017-11-21 19:49:37 +03:00
Nikita Kniazev
34e078d11e
Classic: switch: Fixed right_t
typedef shadowing
2017-11-21 19:49:37 +03:00
Nikita Kniazev
7f012982e2
Classic.Phoenix: composite: Fixed placesholder names shadowing
...
Could be triggered if one uses `using namespace phoenix`.
2017-11-21 19:49:36 +03:00
Nikita Kniazev
138b055a1d
Classic: escape_char: Suppress conditional expression is constant warning
...
`boost/spirit/home/classic/utility/impl/escape_char.ipp(143): warning C4127: conditional expression is constant`
2017-11-21 19:49:36 +03:00
Nikita Kniazev
9bf993abfa
Classic: Fixed iter_policy_t
and scanner_policies_t
shadowing problem
...
`iter_policy_t` and `scanner_policies_t` declared at Spirit's namespace scope.
2017-11-21 19:49:36 +03:00
Nikita Kniazev
8f6a9aaaa3
Classic: file_iterator: Fixed 'size_t' to 'long' conversion warning
2017-11-21 19:49:36 +03:00
Nikita Kniazev
5c44ac5af5
Classic: Fixed unused parameter warnings
2017-11-21 19:49:36 +03:00
Nikita Kniazev
e79f03a062
Qi.Repository: keywords: Fixed unused parameter warnings
...
```
../boost/spirit/repository/home/qi/directive/kwd.hpp:899:76: warning: unused parameter 'modifiers' [-Wunused-parameter]
../boost/spirit/repository/home/qi/directive/kwd.hpp:922:76: warning: unused parameter 'modifiers' [-Wunused-parameter]
../boost/spirit/repository/home/qi/operator/detail/keywords.hpp:510:35: warning: unused parameter 'first' [-Wunused-parameter]
../boost/spirit/repository/home/qi/operator/detail/keywords.hpp:511:41: warning: unused parameter 'last' [-Wunused-parameter]
../boost/spirit/repository/home/qi/operator/detail/keywords.hpp:512:45: warning: unused parameter 'parse_visitor' [-Wunused-parameter]
../boost/spirit/repository/home/qi/operator/detail/keywords.hpp:513:51: warning: unused parameter 'no_case_parse_visitor' [-Wunused-parameter]
../boost/spirit/repository/home/qi/operator/detail/keywords.hpp:514:40: warning: unused parameter 'skipper' [-Wunused-parameter]
../boost/spirit/repository/home/qi/operator/detail/keywords.hpp:573:92: warning: unused parameter 'position' [-Wunused-parameter]
```
2017-11-21 19:49:35 +03:00
Nikita Kniazev
0773ca38d0
Support: utree_detail2: Fixes sign compare warning
2017-11-21 19:49:35 +03:00
Nikita Kniazev
b174d1f282
subrule: Fixed a huge use after scope bug
...
It took me 3 days of pulling my hair to debug and fix the bug. The subrule's
author put a big bomb under it and I caught the exposition only in a single
test, with modern versions of Clang/GCC and enabled optimizations (most of
boost regression test runners does not use `variant=release`). Valgrind did
not catch any problems. Enabling address sanitizer causes the bug to disappear
(now I understand why, it places big gaps between stack pointers).
`-fsanitize-address-use-after-scope` catches the bug, but I have discovered
that it is turned off in Clang by default after already having a repro.
The bug could be easily reproduced if you use any parser that invalidates
it's state in the destructor.
I used `literal_char` with added `~literal_char() { ch = char_type(0); }`.
Reproduction code:
```cpp
rule<char const*> r;
subrule<0> entry;
r = (entry = 'a');
BOOST_TEST(test("a", r));
```
It will fail because after assignment to `r` a temporary `subrule_group` is
destroyed and rule is binded to the already destroyed object.
The cause is in usage of `reference` parser. I am 100% sure the code was
copy-pasted from `rule`/`grammar`. They store an expression within their
body, while `subrule` actually used only as a placeholder.
I have split `subrule_group` into an actual parser/generator that stores the
expression and a Proto terminal that contains the parser/generator.
Tested on:
- VS 2008, 2010, 2015, 2017
- Clang 3.8, 3.9, 4.0, 5.0
- GCC 4.8, 7
2017-11-21 00:37:54 +03:00
Nikita Kniazev
fd10da52b7
Repository: subrule: Fixed partial ordering problem
...
The problem is that `f(T&)` and `f(T&&)` overloads had the same priority
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1164
Affected compilers are:
- MSVC 9/10/11
- GCC 4.7.2, 4.8.4 with `-std=c++1x`
2017-11-15 21:30:32 +03:00
Nikita Kniazev
4ec785d3ed
Merge pull request #271 from Kojoley/fix-alternate
...
Spirit accidentally relays on `types` typedef of `boost::optional`
2017-11-13 17:21:40 +03:00
Nikita Kniazev
e91aa9f3a2
Merge pull request #259 from Kojoley/fix-subrule
...
Fix `subrule` compilation
2017-11-13 17:15:57 +03:00
Nikita Kniazev
cdac069504
Classic: Fixed warning from isblank_
with bool
scanner
...
While I do not see usages for `bool` scanner and consider it is a dumb idea
I have not removed the test. Adding the `isblank(bool)` overload seems to me
as a reasonable compromise because it cannot break anything.
2017-11-12 21:17:38 +03:00
Nikita Kniazev
a9e7f574ee
Classic: Fixed conversion from 'ptrdiff_t' to 'int', possible loss of data
warnings
2017-11-12 17:15:16 +03:00
Nikita Kniazev
99134e9d7b
Merge pull request #275 from Kojoley/fix-classic-boost-optional-has-no-argument_type
...
Classic: Fixed compilation of `match<T &>`
2017-11-12 17:13:03 +03:00
Nikita Kniazev
632252bafc
Merge pull request #274 from Kojoley/fix-classic-phoenix-actor-remove_reference
...
Classic: Fix `remove_reference` usage without a namespace
2017-11-12 17:08:32 +03:00
Nikita Kniazev
85fa626071
Merge pull request #273 from Kojoley/fix-classic-phoenix-special_ops-complex
...
Classic: Fixed `std::complex` usage without the include
2017-11-12 17:07:38 +03:00
Nikita Kniazev
45777098b8
Classic: Fixed compilation of match<T &>
...
`boost::optional<T &>` has member named `argument_type`
I do not know when it did break because defining
`BOOST_OPTIONAL_CONFIG_USE_OLD_IMPLEMENTATION_OF_OPTIONAL`
does not solve the problem.
2017-11-12 03:07:26 +03:00
Nikita Kniazev
41fe4eb5b3
Classic: Fixed unused local typedef in dynamic/for.hpp
2017-11-12 02:50:08 +03:00
Nikita Kniazev
9dac9fb638
Classic: Fixed std::complex
usage without the include
...
08b336d
(#195 ) removed forward declaration but did not add the include.
Closes https://svn.boost.org/trac10/ticket/13240
2017-11-12 02:32:31 +03:00
Nikita Kniazev
ebcedd2523
Classic: Fix remove_reference
usage without a namespace
2017-11-12 02:27:10 +03:00
Nikita Kniazev
03b5ab568d
Spirit accidentally relays on types
typedef of boost::optional
...
Replaces #201 , fixes #249 .
New `boost:optional` implementation does not contain `types` what caused
a compilation error for Qi and wrong results for Karma.
Other problem is that `not_is_variant<optional<variant<T...>>>` results in
`mpl::false_` what is unclear from it's name. While Karma relays on exactly
this behavior, Qi wrongly considers that it `mpl::true_`. I have fixed this
name ambiguity and updated Karma for the new `not_is_variant` behavior.
2017-11-10 22:05:10 +03:00
Nikita Kniazev
23531c8ab3
Merge pull request #269 from Kojoley/fix-qi-keywords-unused-parameter-warnings
...
Qi.Repository: keywords: Fixed unused parameter warnings
2017-11-10 03:37:07 +03:00
Nikita Kniazev
3439373f0c
Qi.Repository: keywords: Fixed unused parameter warnings
2017-11-10 03:34:32 +03:00
Nikita Kniazev
1360fdfd16
utree: Fixed possible loss of data warning
2017-11-10 03:33:16 +03:00
Nikita Kniazev
f7049833a1
Revert "Merge pull request #201 from mxc-commons/fix_alternative"
...
This reverts commit 4c5b976633
, reversing
changes made to 0f7b47d33d
.
2017-11-10 01:20:33 +03:00
Nikita Kniazev
ee4943d589
X3: Fix unused_type
attribute case in parse_into_container
...
Passing `unused_type` attribute to `parse_into_container_impl::call`
produces a compilation error.
The issue was introduced in 379413a50c
.
2017-11-08 19:42:47 +03:00
Nikita Kniazev
688f8c624b
Karma: Fixed no_buffering_policy
missing copy constructor
...
It seems that `no_buffering_policy` had a copy-paste error for 8 years.
2017-11-06 20:32:30 +03:00
Nikita Kniazev
025aa31292
Repository: subrule: Fix proto's operators kicks in on c++11
2017-11-03 19:35:19 +03:00
Nikita Kniazev
7240e1fbe7
Repository: subrule: Fix extract_sig
usage
...
With e34a955f2f
`extract_sig` changed
but `subrule` did not get an update for that change.
2017-11-03 19:27:50 +03:00
Nikita Kniazev
c240c5ecce
Qi.Repository: Fix keywords
compilation on c++11
2017-10-31 21:49:12 +03:00
James E. King, III
c744f31222
silence coverity discovery of ignored return code from at_end
2017-10-20 16:44:10 -04:00
Joel de Guzman
5430289e4b
Merge pull request #248 from m-dhooge/develop
...
x3::error_handler::position() CR+LF lines wrongly counted.
2017-10-10 10:43:04 +08:00
Joel de Guzman
1fcefe5bc8
Merge pull request #245 from dtardon/overflow
...
oss-fuzz: avoid signed integer overflow
2017-10-07 17:08:00 +08:00
mdhooge
79995f7e8f
x3::error_handler::position() CR+LF lines wrongly counted.
2017-10-05 09:51:09 +02:00
Edward Catmur
327b725afc
Store id as promoted type to allow out-of-enum values
2017-10-03 17:00:13 +01:00
Edward Catmur
c342200867
Perform negation in unsigned type to prevent UB
2017-10-03 16:58:40 +01:00
David Tardon
3d8a80c4f3
ofz#2894 avoid signed integer overflow
...
/usr/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp:86:48: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
2017-10-02 16:38:11 +02:00
Ed Catmur
26356b5361
Avoid -Wlogical-op error in radix_traits::is_valid
...
With -Wlogical-op, gcc warns in radix_traits::is_valid with Radix <= 10:
```
boost/spirit/home/qi/numeric/detail/numeric_utils.hpp: In instantiation of ‘static bool boost::spirit::qi::detail::radix_traits<10u>::is_valid<char>(char)’:
[...]
boost/spirit/home/qi/numeric/detail/numeric_utils.hpp:107:31: warning: logical ‘and’ of mutually exclusive tests is always false [-Wlogical-op]
|| (ch >= 'a' && ch <= static_cast<Char>('a' + Radix -10 -1))
^
boost/spirit/home/qi/numeric/detail/numeric_utils.hpp:108:31: warning: logical ‘and’ of mutually exclusive tests is always false [-Wlogical-op]
|| (ch >= 'A' && ch <= static_cast<Char>('A' + Radix -10 -1));
^
```
Rather than suppressing the warning (https://github.com/boostorg/spirit/pull/77 ), refactor the test so that the warning is not triggered.
2017-09-19 18:51:34 +01:00
Adam Merz
b4e4762b6c
Add noexcept specs to x3::variant and forward_ast
...
Add noexcept specifications to X3's variant and forward_ast
2017-08-24 18:05:38 -07:00
Han Wang
19972887f4
Context& -> Context const&
...
fix parsers like x3::skip(x3::space)[x3::double_] compile problem
2017-08-23 10:45:21 +02:00
Han Wang
30dfb6230a
simplify with directive (3): make rvalue injection mutable
2017-08-22 15:43:34 +02:00
Han Wang
361b12eeeb
simplify with directive
...
1. when used as x3::with<ID>(x), where x is an lvalue, we inject an lvalue reference of x to the context.
2. when used as x3::with<ID>(x), where x is a const lvalue, we inject a const lvalue reference of x to the context.
3. when used as x3::with<ID>(x), where x is an rvalue, we move the rvalue to the member of with_directive and inject an lvalue reference of that member to the context.
4. No copy is applied; std::ref is not needed
5. remove unused with_context
2017-08-21 13:48:08 +02:00
Hartmut Kaiser
b187f862b6
Removing use of bind2nd
2017-08-11 04:46:16 -05:00
Joel de Guzman
a476452dbd
use boost::swap instead, which does all the namespace stuff.
2017-08-07 11:14:22 +08:00
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