aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/lexer.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-11-07 11:12:43 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-11-07 11:12:43 +0200
commit882583f64e517ab232edb6bbb7433631c655c9da (patch)
tree3d0e8e16c20b1346cb34961c7f908b07427e9632 /libbuild2/lexer.hxx
parentcf18da3ac461087ccffd31222dbe4fa2e6428d56 (diff)
Initial work on path_name use for `-` to stdin/stdout translation
Diffstat (limited to 'libbuild2/lexer.hxx')
-rw-r--r--libbuild2/lexer.hxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/libbuild2/lexer.hxx b/libbuild2/lexer.hxx
index a2c7431..bd2ac74 100644
--- a/libbuild2/lexer.hxx
+++ b/libbuild2/lexer.hxx
@@ -84,13 +84,14 @@ namespace build2
public:
// If escape is not NULL then only escape sequences with characters from
// this string are considered "effective escapes" with all others passed
- // through as is. Note that the escape string is not copied.
+ // through as is. Note that neither the name nor escape arguments are
+ // copied.
//
lexer (istream& is,
const path& name,
uint64_t line = 1, // Start line in the stream.
const char* escapes = nullptr)
- : lexer (is, name, line, escapes, true /* set_mode */) {}
+ : lexer (is, name, line, escapes, true /* set_mode */) {}
const path&
name () const {return name_;}
@@ -180,13 +181,11 @@ namespace build2
// Lexer state.
//
protected:
- lexer (istream& is,
- const path& name,
- uint64_t line,
+ lexer (istream& is, const path& name, uint64_t line,
const char* escapes,
bool set_mode)
: char_scanner (is, true /* crlf */, line),
- fail ("error", &name_),
+ fail ("error", &name),
name_ (name),
sep_ (false)
{
@@ -194,7 +193,7 @@ namespace build2
mode (lexer_mode::normal, '@', escapes);
}
- const path name_; // @@ TODO: why not shallow (like istream)?
+ const path& name_;
std::stack<state> state_;
bool sep_; // True if we skipped spaces in peek().