From ece4003beebd23082a5fd7a324de40c5572161d1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 16 Mar 2017 10:35:32 +0200 Subject: Add support for passing parameters to (meta-) operations --- build2/test/operation.cxx | 5 ++++- build2/test/script/lexer | 6 +++--- build2/test/script/lexer.cxx | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'build2/test') diff --git a/build2/test/operation.cxx b/build2/test/operation.cxx index 87e3083..1f59fc1 100644 --- a/build2/test/operation.cxx +++ b/build2/test/operation.cxx @@ -12,8 +12,11 @@ namespace build2 namespace test { static operation_id - test_pre (meta_operation_id mo) + test_pre (const values& params, meta_operation_id mo, const location& l) { + if (!params.empty ()) + fail (l) << "unexpected parameters for operation test"; + // Run update as a pre-operation, unless we are disfiguring. // return mo != disfigure_id ? update_id : 0; diff --git a/build2/test/script/lexer b/build2/test/script/lexer index 207cfef..4851e13 100644 --- a/build2/test/script/lexer +++ b/build2/test/script/lexer @@ -49,7 +49,7 @@ namespace build2 const path& name, lexer_mode m, const char* escapes = nullptr) - : base_lexer (is, name, nullptr, nullptr, false) + : base_lexer (is, name, nullptr, false) { mode (m, '\0', escapes); } @@ -67,10 +67,10 @@ namespace build2 void reset_quoted (size_t q) {quoted_ = q;} - protected: virtual token - next_impl () override; + next () override; + protected: token next_line (); diff --git a/build2/test/script/lexer.cxx b/build2/test/script/lexer.cxx index e060869..c7f9193 100644 --- a/build2/test/script/lexer.cxx +++ b/build2/test/script/lexer.cxx @@ -139,7 +139,7 @@ namespace build2 } token lexer:: - next_impl () + next () { token r; @@ -158,7 +158,7 @@ namespace build2 r = next_description (); break; default: - r = base_lexer::next_impl (); + r = base_lexer::next (); break; } -- cgit v1.1