aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/parser.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-06-03 08:39:36 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-06-03 08:39:36 +0200
commitbc3c8492f129d9295c9ef6c325bf2c99e88ca73e (patch)
tree79fa0ccfbf030568caa2d521f3bc3dbc613d4796 /libbuild2/parser.hxx
parent7368566619bc990b69f90a4828be2966854fa785 (diff)
Factor implementation-specific ad hoc recipe parsing to adhoc_*_rule
Diffstat (limited to 'libbuild2/parser.hxx')
-rw-r--r--libbuild2/parser.hxx34
1 files changed, 17 insertions, 17 deletions
diff --git a/libbuild2/parser.hxx b/libbuild2/parser.hxx
index 66a985a..88b4ad9 100644
--- a/libbuild2/parser.hxx
+++ b/libbuild2/parser.hxx
@@ -19,6 +19,23 @@
namespace build2
{
+ struct attribute
+ {
+ string name;
+ build2::value value;
+ };
+
+ ostream&
+ operator<< (ostream&, const attribute&);
+
+ struct attributes: small_vector<attribute, 1>
+ {
+ location loc; // Start location.
+
+ explicit
+ attributes (location l = {}): loc (move (l)) {}
+ };
+
class LIBBUILD2_SYMEXPORT parser
{
public:
@@ -261,23 +278,6 @@ namespace build2
//
// In this example we only apply the value attributes after evaluating
// the context, which has its own attributes.
- //
- struct attribute
- {
- string name;
- build2::value value;
- };
-
- friend ostream&
- operator<< (ostream&, const attribute&);
-
- struct attributes: small_vector<attribute, 1>
- {
- location loc; // Start location.
-
- explicit
- attributes (location l = {}): loc (move (l)) {}
- };
// Push a new entry into the attributes_ stack. If the next token is `[`
// then parse the attribute sequence until ']' storing the result in the