From dfb1415d5eaf006ee45235f275d17f52d3db38e5 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 18 May 2020 12:06:16 +0300 Subject: Add dump(ostream,script::lines) (partial implementation) --- libbuild2/test/script/lexer.test.cxx | 2 +- libbuild2/test/script/token.cxx | 6 +++--- libbuild2/test/script/token.hxx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'libbuild2/test') 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); } } } -- cgit v1.1