+
+ match returning with
+ | RetExpr -> Parse.parse_expr (sprintf "function:%s" name) b
+ | RetString -> Ast.EConstant (loc, Ast.CString b)
+ | RetStrings ->
+ (* run_code always adds \n after the final line, so when we
+ * read it back we will get a final empty string which we
+ * have to drop. XXX Probably better to preserve the lines
+ * read from the external command.
+ *)
+ let strs = nsplit "\n" b in
+ let strs = List.rev strs in
+ let strs = match strs with "" :: xs -> xs | xs -> xs in
+ let strs = List.rev strs in
+ let strs = List.map (fun s -> Ast.EConstant (loc, Ast.CString s)) strs in
+ EList (loc, strs)