From a5bf818ebb55e4e27eb0f067664fd4db70284267 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 8 May 2020 06:34:13 +0200 Subject: Initial support for parsing and dumping recipes --- libbuild2/recipe.hxx | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'libbuild2/recipe.hxx') diff --git a/libbuild2/recipe.hxx b/libbuild2/recipe.hxx index a4933dd..e73a8ea 100644 --- a/libbuild2/recipe.hxx +++ b/libbuild2/recipe.hxx @@ -53,9 +53,28 @@ namespace build2 // struct adhoc_recipe { - build2::action action; - }; + using action_type = build2::action; + using location_type = build2::location; + + action_type action; + string recipe; + optional diag; // Command name for low-verbosity diagnostics. + // Diagnostics-related information. + // + path_name_value file; // Buildfile of recipe. + location_type location; // Buildfile location of recipe. + size_t braces; // Number of braces in multi-brace tokens. + + adhoc_recipe (action_type a, + string r, + optional d, + const location_type& l, size_t b) + : action (a), + recipe (move (r)), + diag (move (d)), + file (l.file), location (file, l.line, l.column), braces (b) {} + }; } #endif // LIBBUILD2_RECIPE_HXX -- cgit v1.1