From bc3c8492f129d9295c9ef6c325bf2c99e88ca73e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 3 Jun 2020 08:39:36 +0200 Subject: Factor implementation-specific ad hoc recipe parsing to adhoc_*_rule --- libbuild2/parser.hxx | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'libbuild2/parser.hxx') 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 + { + 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 - { - 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 -- cgit v1.1