diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-05-08 06:34:13 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-05-27 08:35:29 +0200 |
commit | a5bf818ebb55e4e27eb0f067664fd4db70284267 (patch) | |
tree | 2c0699ba4827cee34161db3da7ec8f94a6175ea9 /libbuild2/recipe.hxx | |
parent | fce9782a330e8f701a8df0b5200e5b78e97ec4b5 (diff) |
Initial support for parsing and dumping recipes
Diffstat (limited to 'libbuild2/recipe.hxx')
-rw-r--r-- | libbuild2/recipe.hxx | 23 |
1 files changed, 21 insertions, 2 deletions
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<string> 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<string> 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 |