Browse Source

ob-ocaml: updated to use the new script-escape function

* lisp/ob-ocaml.el (org-babel-ocaml-read-list): Using
  `org-babel-script-escape'.
  (org-babel-ocaml-read-array): Using `org-babel-script-escape'.
Eric Schulte 14 years ago
parent
commit
892b66f062
1 changed files with 6 additions and 19 deletions
  1. 6 19
      lisp/ob-ocaml.el

+ 6 - 19
lisp/ob-ocaml.el

@@ -125,30 +125,17 @@ OUTPUT is string output from an ocaml process."
   "Convert RESULTS into an elisp table or string.
 If the results look like a table, then convert them into an
 Emacs-lisp table, otherwise return the results as a string."
-  (org-babel-read
-   (if (and (stringp results) (string-match "^\\[.+\\]$" results))
-       (org-babel-read
-        (replace-regexp-in-string
-         "\\[" "(" (replace-regexp-in-string
-                    "\\]" ")" (replace-regexp-in-string
-                               "; " " " (replace-regexp-in-string
-                                         "'" "\"" results)))))
-     results)))
+  (org-babel-script-escape (replace-regexp-in-string ";" "," results)))
 
 (defun org-babel-ocaml-read-array (results)
   "Convert RESULTS into an elisp table or string.
 If the results look like a table, then convert them into an
 Emacs-lisp table, otherwise return the results as a string."
-  (org-babel-read
-   (if (and (stringp results) (string-match "^\\[.+\\]$" results))
-       (org-babel-read
-	(concat
-	 "'" (replace-regexp-in-string
-	      "\\[|" "(" (replace-regexp-in-string
-			  "|\\]" ")" (replace-regexp-in-string
-				      "; " " " (replace-regexp-in-string
-						"'" "\"" results))))))
-     results)))
+    (org-babel-script-escape
+     (replace-regexp-in-string
+      "\\[|" "[" (replace-regexp-in-string
+		  "|\\]" "]" (replace-regexp-in-string
+			      "; " "," results)))))
 
 (provide 'ob-ocaml)