Skip to content

Commit 82184fe

Browse files
committed
Merge remote-tracking branch 'x3/develop' into HEAD
2 parents 08b3d03 + 9801755 commit 82184fe

11 files changed

Lines changed: 89 additions & 41 deletions

File tree

.github/workflows/ci.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: GitHub Actions CI
1+
name: CI
22

33
on:
44
pull_request:
@@ -17,7 +17,7 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
include:
20-
- name: "STD=17 JOB=test/x3"
20+
- name: "C++17 test/x3"
2121
buildtype: "boost"
2222
packages: "clang-18 libc++-18-dev libc++abi-18-dev libunwind-18-dev jq ccache"
2323
packages_to_remove: ""
@@ -29,7 +29,7 @@ jobs:
2929
std: "17"
3030
job: "test/x3"
3131
travis_compiler: "clang-18"
32-
- name: "STD=17 JOB=test/x3"
32+
- name: "C++17 test/x3"
3333
buildtype: "boost"
3434
packages: "g++-13 jq ccache"
3535
packages_to_remove: ""
@@ -41,7 +41,7 @@ jobs:
4141
std: "17"
4242
job: "test/x3"
4343
travis_compiler: "gcc-13"
44-
- name: "STD=11 JOB=test/qi"
44+
- name: "C++11 test/qi"
4545
buildtype: "boost"
4646
packages: "clang-14 libc++-14-dev libc++abi-14-dev libunwind-14-dev jq ccache"
4747
packages_to_remove: ""
@@ -53,7 +53,7 @@ jobs:
5353
std: "11"
5454
job: "test/qi"
5555
travis_compiler: "clang-14"
56-
- name: "STD=11 JOB=test/karma"
56+
- name: "C++11 test/karma"
5757
buildtype: "boost"
5858
packages: "clang-14 libc++-14-dev libc++abi-14-dev libunwind-14-dev jq ccache"
5959
packages_to_remove: ""
@@ -65,7 +65,7 @@ jobs:
6565
std: "11"
6666
job: "test/karma"
6767
travis_compiler: "clang-14"
68-
- name: "STD=11 JOB=test/lex"
68+
- name: "C++11 test/lex"
6969
buildtype: "boost"
7070
packages: "clang-14 libc++-14-dev libc++abi-14-dev libunwind-14-dev jq ccache"
7171
packages_to_remove: ""
@@ -77,7 +77,7 @@ jobs:
7777
std: "11"
7878
job: "test/lex"
7979
travis_compiler: "clang-14"
80-
- name: "STD=11 JOB=test/support"
80+
- name: "C++11 test/support"
8181
buildtype: "boost"
8282
packages: "clang-14 libc++-14-dev libc++abi-14-dev libunwind-14-dev jq ccache"
8383
packages_to_remove: ""
@@ -89,7 +89,7 @@ jobs:
8989
std: "11"
9090
job: "test/support"
9191
travis_compiler: "clang-14"
92-
- name: "STD=11 JOB=repository/test"
92+
- name: "C++11 repository/test"
9393
buildtype: "boost"
9494
packages: "clang-14 libc++-14-dev libc++abi-14-dev libunwind-14-dev jq ccache"
9595
packages_to_remove: ""
@@ -101,7 +101,7 @@ jobs:
101101
std: "11"
102102
job: "repository/test"
103103
travis_compiler: "clang-14"
104-
- name: "STD=11 JOB=test/qi"
104+
- name: "C++11 test/qi"
105105
buildtype: "boost"
106106
packages: "g++-11 jq ccache"
107107
packages_to_remove: ""
@@ -113,7 +113,7 @@ jobs:
113113
std: "11"
114114
job: "test/qi"
115115
travis_compiler: "gcc-11"
116-
- name: "STD=11 JOB=test/karma"
116+
- name: "C++11 test/karma"
117117
buildtype: "boost"
118118
packages: "g++-11 jq ccache"
119119
packages_to_remove: ""
@@ -125,7 +125,7 @@ jobs:
125125
std: "11"
126126
job: "test/karma"
127127
travis_compiler: "gcc-11"
128-
- name: "STD=11 JOB=test/lex"
128+
- name: "C++11 test/lex"
129129
buildtype: "boost"
130130
packages: "g++-11 jq ccache"
131131
packages_to_remove: ""
@@ -137,7 +137,7 @@ jobs:
137137
std: "11"
138138
job: "test/lex"
139139
travis_compiler: "gcc-11"
140-
- name: "STD=11 JOB=test/support"
140+
- name: "C++11 test/support"
141141
buildtype: "boost"
142142
packages: "g++-11 jq ccache"
143143
packages_to_remove: ""
@@ -149,7 +149,7 @@ jobs:
149149
std: "11"
150150
job: "test/support"
151151
travis_compiler: "gcc-11"
152-
- name: "STD=11 JOB=repository/test"
152+
- name: "C++11 repository/test"
153153
buildtype: "boost"
154154
packages: "g++-11 jq ccache"
155155
packages_to_remove: ""
@@ -172,7 +172,13 @@ jobs:
172172

173173
- uses: actions/checkout@v2
174174

175-
- name: linux
175+
- name: Initialize Ubuntu
176+
if: matrix.os == 'ubuntu-22.04'
177+
run: |
178+
sudo echo "set man-db/auto-update false" | sudo debconf-communicate
179+
sudo dpkg-reconfigure man-db
180+
181+
- name: Linux
176182
shell: bash
177183
env:
178184
CXX: ${{ matrix.cxx }}
@@ -194,7 +200,7 @@ jobs:
194200
if [ -n "$PACKAGES_TO_REMOVE" ]; then sudo apt-get purge -y $PACKAGES_TO_REMOVE; fi
195201
echo ">>>>> APT: REPO.."
196202
for i in {1..3}; do sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test" && break || sleep 2; done
197-
203+
198204
if test -n "${LLVM_OS}" ; then
199205
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
200206
if test -n "${LLVM_VER}" ; then
@@ -297,6 +303,6 @@ jobs:
297303
298304
echo '==================================> SCRIPT'
299305
300-
b2 link=shared threading=multi variant=release,sanitize toolset=$TRAVIS_COMPILER cxxstd=$STD $STDLIB warnings=extra warnings-as-errors=on define=BOOST_SPIRIT_X3_HIDE_CXX17_WARNING
306+
b2 link=shared threading=multi variant=release,sanitize toolset=$TRAVIS_COMPILER cxxstd=$STD $STDLIB warnings=extra warnings-as-errors=off define=BOOST_SPIRIT_X3_HIDE_CXX17_WARNING
301307
302308
fi

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# This repository is no longer actively maintained. [Spirit.X4](https://github.com/boostorg/spirit_x4) is the successor and is currently under development.
2+
3+
All components predating X4 currently lack an active maintainer. They are feature-frozen and will accept security patches only.
4+
5+
If you wish to maintain a legacy version, please contact the [Boost developers' mailing list](https://lists.boost.org/).
6+
7+
For background information, see:
8+
9+
- <https://lists.boost.org/archives/list/boost@lists.boost.org/thread/K3EQLEQJHEUBROB6ODUKTZHFP2FDUS2E/?sort=date>
10+
- <https://github.com/boostorg/spirit/issues/795>
11+
- <https://github.com/boostorg/spirit/pull/807>
12+
13+
14+
15+
16+
17+
118
Spirit
219
======
320

doc/qi/numeric.qbk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,9 @@ a user defined numeric type such as fixed_point (fixed point reals) and
508508
bignum (unlimited precision numbers) as long as the type follows certain
509509
expression requirements (documented below).
510510

511+
[warning The `double_` parser and serializer currently produce incorrect values on certain
512+
edge cases. See [@https://github.com/boostorg/spirit/issues/804 boostorg/spirit#804] for details.]
513+
511514
[heading Header]
512515

513516
// forwards to <boost/spirit/home/qi/numeric/real.hpp>

doc/x3/quick_reference.qbk

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -214,21 +214,21 @@ pages and pages of reference documentation.
214214
[section:operator Parser Operators]
215215

216216
[table
217-
[[Expression] [Attribute] [Description]]
218-
[[__x3_not_predicate__] [`Unused`] [Not predicate. If the predicate `a` matches,
217+
[[Expression] [Attribute] [Description]]
218+
[[__x3_not_predicate__ `!a`] [`Unused`] [Not predicate. If the predicate `a` matches,
219219
fail. Otherwise, return a zero length match.]]
220-
[[__x3_and_predicate__] [`Unused`] [And predicate. If the predicate `a` matches,
220+
[[__x3_and_predicate__ `&a`] [`Unused`] [And predicate. If the predicate `a` matches,
221221
return a zero length match. Otherwise, fail.]]
222-
[[__x3_optional__] [`optional<A>`] [Optional. Parse `a` zero or one time]]
223-
[[__x3_kleene__] [`vector<A>`] [Kleene. Parse `a` zero or more times]]
224-
[[__x3_plus__] [`vector<A>`] [Plus. Parse `a` one or more times]]
225-
[[__x3_alternative__] [`variant<A, B>`] [Alternative. Parse `a` or `b`]]
226-
[[__x3_sequence__] [`tuple<A, B>`] [Sequence. Parse `a` followed by `b`]]
227-
[[__x3_expect__] [`tuple<A, B>`] [Expect. Parse `a` followed by `b`. `b` is
222+
[[__x3_optional__ `-a`] [`optional<A>`] [Optional. Parse `a` zero or one time]]
223+
[[__x3_kleene__ `*a`] [`vector<A>`] [Kleene. Parse `a` zero or more times]]
224+
[[__x3_plus__ `+a`] [`vector<A>`] [Plus. Parse `a` one or more times]]
225+
[[__x3_alternative__ `a | b`] [`variant<A, B>`] [Alternative. Parse `a` or `b`]]
226+
[[__x3_sequence__ `a >> b`] [`tuple<A, B>`] [Sequence. Parse `a` followed by `b`]]
227+
[[__x3_expect__ `a > b`] [`tuple<A, B>`] [Expect. Parse `a` followed by `b`. `b` is
228228
expected to match when `a` matches, otherwise,
229229
an `expectation_failure` is thrown.]]
230-
[[__x3_difference__] [`A`] [Difference. Parse `a` but not `b`]]
231-
[[__x3_list__] [`vector<A>`] [List. Parse `a` delimited `b` one or more times]]
230+
[[__x3_difference__ `a - b`] [`A`] [Difference. Parse `a` but not `b`]]
231+
[[__x3_list__ `a % b`] [`vector<A>`] [List. Parse `a` delimited `b` one or more times]]
232232
]
233233

234234
[endsect]

doc/x3/tutorial/minimal.qbk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ example.
1717
So far, to keep things simple, all of the tutorial programs are self
1818
contained in one cpp file. In reality, you will want to separate various
1919
logical modules of the parser into separate cpp and header files, decoupling
20-
the interface from the implememtation.
20+
the interface from the implementation.
2121

2222
There are many ways to structure an X3 parser, but the "minimal" example in
2323
this tutorial shows the preferred way. This example basically reuses the same

include/boost/spirit/home/classic/phoenix/tuples.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//
1919
///////////////////////////////////////////////////////////////////////////////
2020
#ifndef PHOENIX_LIMIT
21-
#define PHOENIX_LIMIT 3
21+
#define PHOENIX_LIMIT 6
2222
#endif
2323

2424
///////////////////////////////////////////////////////////////////////////////

include/boost/spirit/home/karma/numeric/real_policies.hpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,20 @@ namespace boost { namespace spirit { namespace karma
257257
// generate(sink, right_align(precision, '0')[ulong], n);
258258
// but it's spelled out to avoid inter-modular dependencies.
259259

260-
typename remove_const<T>::type digits =
261-
(traits::test_zero(n) ? 1 : ceil(log10(n + T(1.))));
260+
unsigned int digits=1; //should be number of digits n(truncating any fraction)
261+
if(!boost::spirit::traits::test_zero(n)) {
262+
static constexpr uint64_t limit = UINT64_MAX / 10;
263+
const T num = floor(n);
264+
for (uint64_t x = 10u, i = 1u;; x *= 10, i++) {
265+
if (num < x) {
266+
digits=i;break;
267+
}
268+
if (x > limit) {
269+
digits= i + 1;break;
270+
}
271+
}
272+
}
273+
262274
bool r = true;
263275
for (/**/; r && digits < precision_; digits = digits + 1)
264276
r = char_inserter<>::call(sink, '0');

include/boost/spirit/home/qi/operator/expect.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ namespace boost { namespace spirit { namespace qi
4343
{
4444
friend struct sequence_base<expect_operator<Elements>, Elements>;
4545

46-
expect_operator(Elements const& elements)
47-
: sequence_base<expect_operator<Elements>, Elements>(elements) {}
46+
expect_operator(Elements const& elements_)
47+
: sequence_base<expect_operator<Elements>, Elements>(elements_) {}
4848

4949
private:
5050

include/boost/spirit/home/qi/operator/sequence.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ namespace boost { namespace spirit { namespace qi
3939
{
4040
friend struct sequence_base<sequence<Elements>, Elements>;
4141

42-
sequence(Elements const& elements)
43-
: sequence_base<sequence<Elements>, Elements>(elements) {}
42+
sequence(Elements const& elements_)
43+
: sequence_base<sequence<Elements>, Elements>(elements_) {}
4444

4545
private:
4646

include/boost/spirit/home/x3/support/utility/error_reporting.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ namespace boost { namespace spirit { namespace x3
8585
err_out << "In ";
8686
}
8787

88-
err_out << "line " << line << ':' << std::endl;
88+
err_out << "line " << line << ':' << '\n';
8989
}
9090

9191
template <typename Iterator>
@@ -102,7 +102,7 @@ namespace boost { namespace spirit { namespace x3
102102
}
103103
typedef typename std::iterator_traits<Iterator>::value_type char_type;
104104
std::basic_string<char_type> line{start, end};
105-
err_out << x3::to_utf8(line) << std::endl;
105+
err_out << x3::to_utf8(line) << '\n';
106106
}
107107

108108
template <typename Iterator>
@@ -165,12 +165,12 @@ namespace boost { namespace spirit { namespace x3
165165
Iterator last = pos_cache.last();
166166

167167
print_file_line(position(err_pos));
168-
err_out << error_message << std::endl;
168+
err_out << error_message << '\n';
169169

170170
Iterator start = get_line_start(first, err_pos);
171171
print_line(start, last);
172172
print_indicator(start, err_pos, '_');
173-
err_out << "^_" << std::endl;
173+
err_out << "^_" << '\n';
174174
}
175175

176176
template <typename Iterator>
@@ -181,13 +181,13 @@ namespace boost { namespace spirit { namespace x3
181181
Iterator last = pos_cache.last();
182182

183183
print_file_line(position(err_first));
184-
err_out << error_message << std::endl;
184+
err_out << error_message << '\n';
185185

186186
Iterator start = get_line_start(first, err_first);
187187
print_line(start, last);
188188
print_indicator(start, err_first, ' ');
189189
print_indicator(start, err_last, '~');
190-
err_out << " <<-- Here" << std::endl;
190+
err_out << " <<-- Here" << '\n';
191191
}
192192

193193
}}}

0 commit comments

Comments
 (0)