Special case t.items = [Text _] and t.items = []

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
Rudi Grinberg 2018-06-06 19:35:04 +07:00
parent 243f3437f2
commit 9cc8ff920a
1 changed files with 2 additions and 0 deletions

View File

@ -170,6 +170,8 @@ let partial_expand t ~mode ~dir ~f =
end
in
match t.items with
| [] -> Partial.Expanded (Mode.string mode "")
| [Text s] -> Expanded (Mode.string mode s)
| [Var (syntax, v)] when not t.quoted ->
(* Unquoted single var *)
begin match f syntax t.loc v with