mirror of
https://github.com/boostorg/parser.git
synced 2026-02-21 03:12:08 +00:00
Add define BOOST_PARSER_DISABLE_TRACE to disable trace mode at compile time.
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.
This commit is contained in:
27
test/disable_trace.cpp
Normal file
27
test/disable_trace.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
Reference in New Issue
Block a user