From 65340a0a897c91b580db1de0bab026a0814c5d74 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 30 Mar 2020 10:16:14 +0200 Subject: Regenerate options parsing code --- build2/b-options.hxx | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'build2/b-options.hxx') diff --git a/build2/b-options.hxx b/build2/b-options.hxx index 4b1852b..44777f7 100644 --- a/build2/b-options.hxx +++ b/build2/b-options.hxx @@ -12,6 +12,7 @@ // // End prologue. +#include #include #include #include @@ -341,6 +342,19 @@ namespace build2 virtual void skip (); + // Return the file path if the peeked at argument came from a file and + // the empty string otherwise. The reference is guaranteed to be valid + // till the end of the scanner lifetime. + // + const std::string& + peek_file (); + + // Return the 1-based line number if the peeked at argument came from + // a file and zero otherwise. + // + std::size_t + peek_line (); + private: const option_info* find (const char*) const; @@ -355,7 +369,15 @@ namespace build2 const option_info* options_; std::size_t options_count_; - std::deque args_; + struct arg + { + std::string value; + const std::string* file; + std::size_t line; + }; + + std::deque args_; + std::list files_; // Circular buffer of two arguments. // @@ -365,6 +387,7 @@ namespace build2 bool skip_; static int zero_argc_; + static std::string empty_string_; }; template -- cgit v1.1