Browse Source

use org-babel-result-cond in OCaml code blocks

* lisp/ob-ocaml.el (org-babel-execute:ocaml): Use org-babel-result-cond
  in OCaml code blocks.
Eric Schulte 7 years ago
parent
commit
f58889f0c1
1 changed files with 5 additions and 1 deletions
  1. 5 1
      lisp/ob-ocaml.el

+ 5 - 1
lisp/ob-ocaml.el

@@ -74,7 +74,11 @@
 					 (progn (setq out t) nil))))
 				   (mapcar #'org-babel-trim (reverse raw))))))))
     (org-babel-reassemble-table
-     (org-babel-ocaml-parse-output (org-babel-trim clean))
+     (let ((raw (org-babel-trim clean)))
+       (org-babel-result-cond (cdr (assoc :result-params params))
+	 ;; strip type information from output
+	 (if (string-match "= \\(.+\\)$" raw) (match-string 1 raw) raw)
+	 (org-babel-ocaml-parse-output raw)))
      (org-babel-pick-name
       (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
      (org-babel-pick-name