aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/test
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-05-18 12:06:16 +0300
committerBoris Kolpackov <boris@codesynthesis.com>2020-05-27 08:35:29 +0200
commitef5969da26c9c89533a7b480f365739aa37472ff (patch)
tree455beb2e612c895407ac7d3ee540785a7f640a52 /libbuild2/test
parente1c923e1c5cc07d21669cc2452b780a321df1bec (diff)
Add dump(ostream,script::lines) (partial implementation)
Diffstat (limited to 'libbuild2/test')
-rw-r--r--libbuild2/test/script/lexer.test.cxx2
-rw-r--r--libbuild2/test/script/token.cxx6
-rw-r--r--libbuild2/test/script/token.hxx2
3 files changed, 5 insertions, 5 deletions
diff --git a/libbuild2/test/script/lexer.test.cxx b/libbuild2/test/script/lexer.test.cxx
index c728d68..9c64616 100644
--- a/libbuild2/test/script/lexer.test.cxx
+++ b/libbuild2/test/script/lexer.test.cxx
@@ -56,7 +56,7 @@ namespace build2
{
// Print each token on a separate line without quoting operators.
//
- t.printer (cout, t, false);
+ t.printer (cout, t, print_mode::normal);
cout << endl;
}
}
diff --git a/libbuild2/test/script/token.cxx b/libbuild2/test/script/token.cxx
index df5493f..efeb17b 100644
--- a/libbuild2/test/script/token.cxx
+++ b/libbuild2/test/script/token.cxx
@@ -12,11 +12,11 @@ namespace build2
namespace script
{
void
- token_printer (ostream& os, const token& t, bool d)
+ token_printer (ostream& os, const token& t, print_mode m)
{
// Only quote non-name tokens for diagnostics.
//
- const char* q (d ? "'" : "");
+ const char* q (m == print_mode::diagnostics ? "'" : "");
switch (t.type)
{
@@ -27,7 +27,7 @@ namespace build2
case token_type::plus: os << q << '+' << q; break;
case token_type::minus: os << q << '-' << q; break;
- default: build2::script::token_printer (os, t, d);
+ default: build2::script::token_printer (os, t, m);
}
}
}
diff --git a/libbuild2/test/script/token.hxx b/libbuild2/test/script/token.hxx
index 5bb2319..dead796 100644
--- a/libbuild2/test/script/token.hxx
+++ b/libbuild2/test/script/token.hxx
@@ -37,7 +37,7 @@ namespace build2
};
void
- token_printer (ostream&, const token&, bool);
+ token_printer (ostream&, const token&, print_mode);
}
}
}