diff options
-rw-r--r-- | build2/test/script/lexer.cxx | 4 | ||||
-rw-r--r-- | build2/test/script/parser.cxx | 22 | ||||
-rw-r--r-- | build2/test/script/script | 2 | ||||
-rw-r--r-- | build2/test/script/script.cxx | 7 | ||||
-rw-r--r-- | build2/test/script/token | 4 | ||||
-rw-r--r-- | build2/test/script/token.cxx | 4 | ||||
-rw-r--r-- | doc/testscript.cli | 6 |
7 files changed, 28 insertions, 21 deletions
diff --git a/build2/test/script/lexer.cxx b/build2/test/script/lexer.cxx index ddab531..ea906a1 100644 --- a/build2/test/script/lexer.cxx +++ b/build2/test/script/lexer.cxx @@ -235,7 +235,7 @@ namespace build2 switch (p) { - case '+': return make_token (type::in_std); + case '+': return make_token (type::in_pass); case '-': return make_token (type::in_null); case ':': return make_token (type::in_str_nn); case '<': @@ -268,7 +268,7 @@ namespace build2 switch (p) { - case '+': return make_token (type::out_std); + case '+': return make_token (type::out_pass); case '-': return make_token (type::out_null); case ':': return make_token (type::out_str_nn); case '>': diff --git a/build2/test/script/parser.cxx b/build2/test/script/parser.cxx index 183b8ac..2e5e9df 100644 --- a/build2/test/script/parser.cxx +++ b/build2/test/script/parser.cxx @@ -506,7 +506,7 @@ namespace build2 // switch (tt) { - case type::in_std: + case type::in_pass: case type::in_null: case type::in_str: case type::in_str_nn: @@ -518,7 +518,7 @@ namespace build2 break; } - case type::out_std: + case type::out_pass: case type::out_null: case type::out_str: case type::out_str_nn: @@ -535,8 +535,8 @@ namespace build2 redirect_type rt; switch (tt) { - case type::in_std: - case type::out_std: rt = redirect_type::std; break; + case type::in_pass: + case type::out_pass: rt = redirect_type::pass; break; case type::in_null: case type::out_null: rt = redirect_type::null; break; @@ -558,7 +558,7 @@ namespace build2 switch (rt) { case redirect_type::none: - case redirect_type::std: + case redirect_type::pass: case redirect_type::null: break; case redirect_type::here_string: @@ -601,8 +601,8 @@ namespace build2 break; } - case type::in_std: - case type::out_std: + case type::in_pass: + case type::out_pass: case type::in_null: case type::out_null: @@ -659,8 +659,8 @@ namespace build2 // switch (tt) { - case type::in_std: - case type::out_std: + case type::in_pass: + case type::out_pass: case type::in_null: case type::out_null: @@ -801,8 +801,8 @@ namespace build2 // switch (tt) { - case type::in_std: - case type::out_std: + case type::in_pass: + case type::out_pass: case type::in_null: case type::out_null: diff --git a/build2/test/script/script b/build2/test/script/script index 639bba9..8b6c3c0 100644 --- a/build2/test/script/script +++ b/build2/test/script/script @@ -41,7 +41,7 @@ namespace build2 enum class redirect_type { none, - std, + pass, null, here_string, // Value is the string. here_document // Value is the document. diff --git a/build2/test/script/script.cxx b/build2/test/script/script.cxx index 95e6344..da9c83a 100644 --- a/build2/test/script/script.cxx +++ b/build2/test/script/script.cxx @@ -37,10 +37,15 @@ namespace build2 size_t n (string::traits_type::length (prefix)); assert (n > 0); + //@@ TODO: we don't handle 'exact' (<: <<: etc). Could check for + // lack of newline at the end of value. In fact, won't we write + // here-end on the same line if <<:. Also will write newline at + // the end of here-string in case of <. + // switch (r.type) { case redirect_type::none: assert (false); break; - case redirect_type::std: o << '+'; break; + case redirect_type::pass: o << '+'; break; case redirect_type::null: o << '-'; break; case redirect_type::here_string: to_stream_q (o, r.value); break; case redirect_type::here_document: diff --git a/build2/test/script/token b/build2/test/script/token index 64c1a0c..1d4f2e4 100644 --- a/build2/test/script/token +++ b/build2/test/script/token @@ -31,14 +31,14 @@ namespace build2 log_and, // && log_or, // || - in_std, // <+ + in_pass, // <+ in_null, // <- in_str, // < in_str_nn, // <: in_doc, // << in_doc_nn, // <<: - out_std, // >+ + out_pass, // >+ out_null, // >- out_str, // > out_str_nn, // >: diff --git a/build2/test/script/token.cxx b/build2/test/script/token.cxx index 93f4f83..2e86e29 100644 --- a/build2/test/script/token.cxx +++ b/build2/test/script/token.cxx @@ -28,14 +28,14 @@ namespace build2 case token_type::log_and: os << q << "&&" << q; break; case token_type::log_or: os << q << "||" << q; break; - case token_type::in_std: os << q << "<+" << q; break; + case token_type::in_pass: os << q << "<+" << q; break; case token_type::in_null: os << q << "<-" << q; break; case token_type::in_str: os << q << '<' << q; break; case token_type::in_str_nn: os << q << "<:" << q; break; case token_type::in_doc: os << q << "<<" << q; break; case token_type::in_doc_nn: os << q << "<<:" << q; break; - case token_type::out_std: os << q << ">+" << q; break; + case token_type::out_pass: os << q << ">+" << q; break; case token_type::out_null: os << q << ">-" << q; break; case token_type::out_str: os << q << '>' << q; break; case token_type::out_str_nn: os << q << ">:" << q; break; diff --git a/doc/testscript.cli b/doc/testscript.cli index 825fde0..0a4bd8f 100644 --- a/doc/testscript.cli +++ b/doc/testscript.cli @@ -728,11 +728,13 @@ stdin: '0'?(in-redirect) stdout: '1'?(out-redirect) stderr: '2'(out-redirect) -in-redirect: '<!'|\ +in-redirect: '<-'|\ + '<+'|\ ('<'|'<:') <text>|\ ('<<'|'<<:') <here-end> -out-redirect: '>!'|\ +out-redirect: '>-'|\ + '>+'|\ ('>'|'>:') <text>|\ ('>>'|'>>:') <here-end> |