@@ -167,6 +167,26 @@ TEST_CASE("Parser sequence fails when following rule does not match.", "[parser]
167
167
STATIC_REQUIRE (result.failure ().loc () == 1 );
168
168
}
169
169
170
+ static testing::context ctx ();
171
+
172
+ namespace percy {
173
+ struct parser <testing::tracker1> {
174
+ using result_type = result<eof>;
175
+
176
+ constexpr static result_type parse (Input input) {
177
+ return succeed (testing::tracker1 (&ctx), {input.loc (), input.loc () + 1 });
178
+ }
179
+ };
180
+ }
181
+
182
+ TEST_CASE (" Parser sequence correctly handles lifetimes." , " [parser][sequence]" ) {
183
+ using parser = percy::parser<percy::sequence<testing::tracker1>>;
184
+
185
+ PERCY_CONSTEXPR auto result - parser::parse (percy::input (" xxx" ));
186
+
187
+ //
188
+ }
189
+
170
190
TEST_CASE (" Parser either succeeds when first rule matches." , " [parser][either]" ) {
171
191
using parser = percy::parser<percy::either<percy::symbol<' a' >, percy::symbol<' b' >>>;
172
192
@@ -236,7 +256,7 @@ TEST_CASE("Parser one_of fails when no rule matches.", "[parser][one_of]") {
236
256
TEST_CASE (" Parser many succeeds even when rule matches zero times." , " [parser][many]" ) {
237
257
using parser = percy::parser<percy::many<percy::symbol<' x' >>>;
238
258
239
- PERCY_CONSTEXPR auto result = parser::parse (percy::input (" abc" ));
259
+ auto result = parser::parse (percy::input (" abc" ));
240
260
241
261
REQUIRE (result.is_success ());
242
262
REQUIRE (result->begin () == 0 );
@@ -247,7 +267,7 @@ TEST_CASE("Parser many succeeds even when rule matches zero times.", "[parser][m
247
267
TEST_CASE (" Parser many succeeds when rule matches multiple times." , " [parser][many]" ) {
248
268
using parser = percy::parser<percy::many<percy::symbol<' a' >>>;
249
269
250
- PERCY_CONSTEXPR auto result = parser::parse (percy::input (" aac" ));
270
+ auto result = parser::parse (percy::input (" aac" ));
251
271
252
272
REQUIRE (result.is_success ());
253
273
REQUIRE (result->begin () == 0 );
@@ -258,7 +278,7 @@ TEST_CASE("Parser many succeeds when rule matches multiple times.", "[parser][ma
258
278
TEST_CASE (" Parser many stops at the input end." , " [parser][many]" ) {
259
279
using parser = percy::parser<percy::many<percy::symbol<' a' >>>;
260
280
261
- PERCY_CONSTEXPR auto result = parser::parse (percy::input (" aaa" ));
281
+ auto result = parser::parse (percy::input (" aaa" ));
262
282
263
283
REQUIRE (result.is_success ());
264
284
REQUIRE (result->begin () == 0 );
0 commit comments