forked from mirrors/org-mode
ob-ebnf: Fix copyright and style
* lisp/ob-ebnf.el (org-babel-execute:ebnf): Fix style.
This commit is contained in:
parent
0be044736c
commit
dc00c4afe6
|
@ -1,6 +1,6 @@
|
||||||
;;; ob-ebnf.el --- org-babel functions for ebnf evaluation
|
;;; ob-ebnf.el --- org-babel functions for ebnf evaluation
|
||||||
|
|
||||||
;; Copyright (C) your name here
|
;; Copyright (C) 2013 Free Software Foundation, Inc.
|
||||||
|
|
||||||
;; Author: Michael Gauland
|
;; Author: Michael Gauland
|
||||||
;; Keywords: literate programming, reproducible research
|
;; Keywords: literate programming, reproducible research
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
;;;
|
;;;
|
||||||
;;; :style specifies a value in ebnf-style-database. This provides the
|
;;; :style specifies a value in ebnf-style-database. This provides the
|
||||||
;;; ability to customise the output. The style can also specify the
|
;;; ability to customise the output. The style can also specify the
|
||||||
;;; gramnmar syntax (by setting ebnf-syntax); note that only ebnf,
|
;;; grammar syntax (by setting ebnf-syntax); note that only ebnf,
|
||||||
;;; iso-ebnf, and yacc are supported by this file.
|
;;; iso-ebnf, and yacc are supported by this file.
|
||||||
|
|
||||||
;;; Requirements:
|
;;; Requirements:
|
||||||
|
@ -64,14 +64,13 @@ called by `org-babel-execute-src-block'"
|
||||||
(result nil))
|
(result nil))
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(when style (ebnf-push-style style))
|
(when style (ebnf-push-style style))
|
||||||
(let
|
(let ((comment-format
|
||||||
((comment-format
|
(cond ((string= ebnf-syntax 'yacc) "/*%s*/")
|
||||||
(cond ((string= ebnf-syntax 'yacc) "/*%s*/")
|
((string= ebnf-syntax 'ebnf) ";%s")
|
||||||
((string= ebnf-syntax 'ebnf) ";%s")
|
((string= ebnf-syntax 'iso-ebnf) "(*%s*)")
|
||||||
((string= ebnf-syntax 'iso-ebnf) "(*%s*)")
|
(t (setq result
|
||||||
(t (setq result
|
(format "EBNF error: format %s not supported."
|
||||||
(format "EBNF error: format %s not supported."
|
ebnf-syntax))))))
|
||||||
ebnf-syntax))))))
|
|
||||||
(setq ebnf-eps-prefix dest-dir)
|
(setq ebnf-eps-prefix dest-dir)
|
||||||
(insert (format comment-format (format "[%s" dest-root)))
|
(insert (format comment-format (format "[%s" dest-root)))
|
||||||
(newline)
|
(newline)
|
||||||
|
@ -80,8 +79,7 @@ called by `org-babel-execute-src-block'"
|
||||||
(insert (format comment-format (format "]%s" dest-root)))
|
(insert (format comment-format (format "]%s" dest-root)))
|
||||||
(ebnf-eps-buffer)
|
(ebnf-eps-buffer)
|
||||||
(when style (ebnf-pop-style))))
|
(when style (ebnf-pop-style))))
|
||||||
result
|
result)))
|
||||||
)))
|
|
||||||
|
|
||||||
(provide 'ob-ebnf)
|
(provide 'ob-ebnf)
|
||||||
;;; ob-ebnf.el ends here
|
;;; ob-ebnf.el ends here
|
||||||
|
|
Loading…
Reference in New Issue