result = make_operation<rust_array_operation> (std::move (expr),
std::move (rhs));
}
- else if (current_token == ',')
+ else if (current_token == ',' || current_token == ']')
{
std::vector<operation_up> ops;
ops.push_back (std::move (expr));
int len = ops.size () - 1;
result = make_operation<array_operation> (0, len, std::move (ops));
}
- else if (current_token != ']')
+ else
error (_("',', ';', or ']' expected"));
require (']');
gdb_test "print \[mut 1,2,3,4\]" " = \\\[1, 2, 3, 4\\\]"
gdb_test "print \[1,2 3" "',' or ']' expected"
gdb_test "print \[1 2" "',', ';', or ']' expected"
+gdb_test "print \[23\]" " = \\\[23\\\]"
gdb_test "print b\"hi rust\"" " = b\"hi rust\""
# This isn't rusty syntax yet, but that's another bug -- this is just