Force users to write (bash ...) when they want it

This commit is contained in:
Jeremie Dimino 2017-03-03 13:18:52 +00:00
parent 8633236dfa
commit c3c3e9e9b5
1 changed files with 2 additions and 6 deletions

View File

@ -63,6 +63,7 @@ module Mini_shexp = struct
; cstr "copy-and-add-line-directive" (p @> p @> nil) (fun src dst ->
Copy_and_add_line_directive (src, dst))
; cstr "system" (a @> nil) (fun cmd -> System cmd)
; cstr "bash" (a @> nil) (fun cmd -> Bash cmd)
]
sexp
@ -108,14 +109,9 @@ module Mini_shexp = struct
module Unexpanded = struct
type t = (String_with_vars.t, String_with_vars.t) Ast.t
let t = Ast.t String_with_vars.t String_with_vars.t sexp
let sexp_of_t = Ast.sexp_of_t String_with_vars.sexp_of_t String_with_vars.sexp_of_t
let t sexp =
match sexp with
| Atom _ -> Bash (String_with_vars.t sexp)
| List _ -> Ast.t String_with_vars.t String_with_vars.t sexp
let fold_vars t ~init ~f =
Ast.fold t ~init ~f:(fun acc pat ->
String_with_vars.fold ~init:acc pat ~f)