let expand loc quotation tag =
let pos_tag = DynAst.string_of_tag tag in
let name = quotation.q_name in
let expander =
try find name tag
with | (Loc.Exc_located (_, (Error.E _)) as exc) -> raise exc
| Loc.Exc_located (qloc, exc) ->
raise
(Loc.Exc_located (qloc,
(Error.E ((name, pos_tag, Finding, exc)))))
| exc ->
raise
(Loc.Exc_located (loc,
(Error.E ((name, pos_tag, Finding, exc))))) in
let loc = Loc.join (Loc.move `start quotation.q_shift loc)
in expand_quotation loc expander pos_tag quotation