aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/parser.test.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-11-12 15:59:58 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-11-13 17:30:25 +0300
commit861555876837449fd8fc480845f642dab4a68b1e (patch)
tree737992e719b5b5bee5574d3cba18e21b2ecbd912 /libbuild2/cc/parser.test.cxx
parent1dc4b29bb57b14bfd8f700be80224b6d865f0184 (diff)
Use path_name in cc::lexer class
Diffstat (limited to 'libbuild2/cc/parser.test.cxx')
-rw-r--r--libbuild2/cc/parser.test.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/libbuild2/cc/parser.test.cxx b/libbuild2/cc/parser.test.cxx
index 82c68d1..9d90653 100644
--- a/libbuild2/cc/parser.test.cxx
+++ b/libbuild2/cc/parser.test.cxx
@@ -24,22 +24,26 @@ namespace build2
{
try
{
- const char* file;
+ path file;
+ path_name in;
ifdstream is;
+
if (argc > 1)
{
- file = argv[1];
+ file = path (argv[1]);
+
+ in = path_name (file);
is.open (file);
}
else
{
- file = "stdin";
+ in = path_name ("<stdin>");
is.open (fddup (stdin_fd ()));
}
parser p;
- unit u (p.parse (is, path (file)));
+ unit u (p.parse (is, in));
unit_type ut (u.type);
for (const module_import& m: u.module_info.imports)