aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-11-04 08:45:17 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 09:26:18 +0200
commita81154d0cbfaa9ee5fd0be049a44e0254ccc98b9 (patch)
treea7c30cb8fc7e363ca24f5a5d4cb31cf151b7176f
parent47d4dc98fa3eaf1f139a03001fd820d398b6b197 (diff)
Use parse_* naming for parsing functions (testscript)
-rw-r--r--build2/test/script/parser2
-rw-r--r--build2/test/script/parser.cxx18
2 files changed, 10 insertions, 10 deletions
diff --git a/build2/test/script/parser b/build2/test/script/parser
index ea0cadb..267c575 100644
--- a/build2/test/script/parser
+++ b/build2/test/script/parser
@@ -53,7 +53,7 @@ namespace build2
parse_variable_line (token&, token_type&, string);
void
- parse_test_line (token&, token_type&, names_type, location);
+ parse_test_line (token&, token_type&, names, location);
command_exit
parse_command_exit (token&, token_type&);
diff --git a/build2/test/script/parser.cxx b/build2/test/script/parser.cxx
index 4948679..fd8010c 100644
--- a/build2/test/script/parser.cxx
+++ b/build2/test/script/parser.cxx
@@ -59,10 +59,10 @@ namespace build2
{
// Parse first chunk. Keep track of whether anything in it was quoted.
//
- names_type ns;
+ names ns;
location nl (get_location (t));
lexer_->reset_quoted (t.quoted);
- names (t, tt, ns, true, "variable or program name");
+ parse_names (t, tt, ns, true, "variable or program name");
// See if this is a variable assignment or a test command.
//
@@ -113,12 +113,12 @@ namespace build2
parse_variable_line (token& t, token_type& tt, string name)
{
type kind (tt); // Assignment kind.
- const variable_type& var (script_->var_pool.insert (move (name)));
+ const variable& var (script_->var_pool.insert (move (name)));
// We cannot reuse the value mode since it will recognize { which
// we want to treat as a literal.
//
- value rhs (variable_value (t, tt, lexer_mode::variable_line));
+ value rhs (parse_variable_value (t, tt, lexer_mode::variable_line));
if (tt != type::newline)
fail (t) << "unexpected " << t;
@@ -129,11 +129,11 @@ namespace build2
// @@ Need to adjust to make strings the default type.
//
- value_attributes (&var, lhs, move (rhs), kind);
+ apply_value_attributes (&var, lhs, move (rhs), kind);
}
void parser::
- parse_test_line (token& t, token_type& tt, names_type ns, location nl)
+ parse_test_line (token& t, token_type& tt, names ns, location nl)
{
// Stop recognizing variable assignments.
//
@@ -460,7 +460,7 @@ namespace build2
ns.clear ();
lexer_->reset_quoted (t.quoted);
nl = get_location (t);
- names (t, tt, ns, true, "command");
+ parse_names (t, tt, ns, true, "command");
continue;
}
}
@@ -533,7 +533,7 @@ namespace build2
{
// The next chunk should be the exit status.
//
- names_type ns (names (t, tt, true, "exit status"));
+ names ns (parse_names (t, tt, true, "exit status"));
//@@ TODO: validate to be single, simple, non-empty name that
// converts to integer (is exit status always non-negative).
@@ -561,7 +561,7 @@ namespace build2
// Expand the line.
//
- names_type ns (names (t, tt, false, "here-document line"));
+ names ns (parse_names (t, tt, false, "here-document line"));
// What shall we do if the expansion results in multiple names? For,
// example if the line contains just the variable expansion and it