;;; srecode/compile --- Compilation of srecode template files.
-;;; Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Keywords: codegeneration
;; Compile a Semantic Recoder template file.
;;
;; Template files are parsed using a Semantic/Wisent parser into
-;; a tag table. The code therin is then further parsed down using
+;; a tag table. The code therein is then further parsed down using
;; a regular expression parser.
;;
;; The output are a series of EIEIO objects which represent the
;; templates in a way that could be inserted later.
+(eval-when-compile (require 'cl))
(require 'semantic)
(require 'eieio)
(require 'eieio-base)
(require 'srecode)
(require 'srecode/table)
-(declare-function srecode-template-inserter-newline-child-p "srecode/insert")
+(declare-function srecode-template-inserter-newline-child-p "srecode/insert"
+ t t)
(declare-function srecode-create-section-dictionary "srecode/dictionary")
(declare-function srecode-dictionary-compound-variable "srecode/dictionary")
(defun srecode-flush-active-templates ()
"Flush the active template storage.
-Useful if something goes wrong in SRecode, and the active tempalte
+Useful if something goes wrong in SRecode, and the active template
stack is broken."
(interactive)
(if (oref srecode-template active)
(set-buffer (semantic-find-file-noselect fname))
(set-buffer peb))
;; Do the compile.
+ (unless (semantic-active-p)
+ (semantic-new-buffer-fcn))
(srecode-compile-templates)
;; Trash the buffer if we had to read it in.
(if (not peb)
;; Local variables:
;; generated-autoload-file: "loaddefs.el"
-;; generated-autoload-feature: srecode/loaddefs
;; generated-autoload-load-name: "srecode/compile"
;; End:
+;; arch-tag: d993ffab-2704-4bb2-bd92-eafe803af3be
;;; srecode/compile.el ends here