mirror of
https://github.com/boostorg/parser.git
synced 2026-02-21 03:12:08 +00:00
The trace feature doubles the compile time, even if never used. This patch introduces the preprocessor define BOOST_PARSER_DISABLE_TRACE to deactivate this feature at compile time.
27 lines
742 B
C++
27 lines
742 B
C++
/**
|
|
* Copyright (C) 2025
|
|
*
|
|
* Distributed under the Boost Software License, Version 1.0. (See
|
|
* accompanying file LICENSE_1_0.txt or copy at
|
|
* http://www.boost.org/LICENSE_1_0.txt)
|
|
*/
|
|
|
|
#define BOOST_PARSER_DISABLE_TRACE
|
|
|
|
#include <boost/core/lightweight_test.hpp>
|
|
#include <boost/parser/parser.hpp>
|
|
|
|
int main()
|
|
{
|
|
namespace bp = boost::parser;
|
|
{
|
|
auto const parser =
|
|
bp::string("FOO") >> -(bp::string("bar") | bp::string("foo"));
|
|
|
|
auto result = bp::parse("FOOfoo", parser);
|
|
BOOST_TEST(result);
|
|
BOOST_TEST(bp::get(*result, bp::llong<0>{}) == std::string("FOO"));
|
|
BOOST_TEST(bp::get(*result, bp::llong<1>{}) == std::string("foo"));
|
|
}
|
|
return boost::report_errors();
|
|
} |