Merge pull request #233 from dra27/improve-include-error

Improve error handling for (:include )
This commit is contained in:
Rudi Grinberg 2017-08-25 14:00:48 -04:00 committed by GitHub
commit a7406ab169
1 changed files with 4 additions and 1 deletions

View File

@ -82,9 +82,12 @@ module Unexpanded = struct
let open Ast in
match t with
| Element s -> Element s
| Special (l, s) -> Special (l, s)
| Union [Special (_, "include"); Element fn] ->
Include (Sexp.Of_sexp.string fn)
| Union [Special (loc, "include"); _]
| Special (loc, "include") ->
Loc.fail loc "(:include expects a single element (do you need to quote the filename?)"
| Special (l, s) -> Special (l, s)
| Union l ->
Union (List.map l ~f:map)
| Diff (l, r) ->