]> code.delx.au - gnu-emacs/blobdiff - lisp/cedet/semantic/grammar.el
Merge from emacs-23; up to 2010-06-01T01:49:15Z!monnier@iro.umontreal.ca
[gnu-emacs] / lisp / cedet / semantic / grammar.el
index 8f5d1cd3e149f5f2f9c6f4882f7ceb58cdc9dfe0..270668e29593a7cd0c9cff868cf597473876eeb6 100644 (file)
@@ -1,7 +1,6 @@
 ;;; semantic/grammar.el --- Major mode framework for Semantic grammars
 
-;; Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 2002-2005, 2007-2011  Free Software Foundation, Inc.
 
 ;; Author: David Ponce <david@dponce.com>
 ;; Maintainer: David Ponce <david@dponce.com>
@@ -248,10 +247,7 @@ That is tag names plus names defined in tag attribute `:rest'."
               (skip-chars-backward "\r\n\t")
               ;; If a grammar footer is found, skip it.
               (re-search-backward "^;;;\\s-+\\S-+\\s-+ends here"
-                                  (save-excursion
-                                    (beginning-of-line)
-                                    (point))
-                                  t)
+                                  (point-at-bol) t)
               (skip-chars-backward "\r\n\t")
               (point)))
            "\n"))
@@ -928,6 +924,12 @@ Lisp code."
         ;; If running interactively, eval declarations and epilogue
         ;; code, then pop to the buffer visiting the generated file.
         (eval-region (point) (point-max))
+       ;; Loop over the defvars and eval them explicitly to force
+       ;; them to be evaluated and ready to use.
+        (goto-char (point-min))
+       (while (re-search-forward "(defvar " nil t)
+         (eval-defun nil))
+       ;; Move cursor to a logical spot in the generated code.
         (goto-char (point-min))
         (pop-to-buffer (current-buffer))
         ;; The generated code has been evaluated and updated into
@@ -1513,7 +1515,7 @@ Return the tag found or nil if not found."
   (car (semantic-find-tags-by-class
         'function
         (or (semantic-find-tags-by-name name (current-buffer))
-            (and (featurep 'semanticdb)
+            (and (featurep 'semantic/db)
                  semanticdb-current-database
                  (cdar (semanticdb-find-tags-by-name name nil t)))))))
 
@@ -1891,5 +1893,4 @@ Optional argument COLOR determines if color is added to the text."
 
 (provide 'semantic/grammar)
 
-;; arch-tag: 12ffc9d5-557d-49af-a5fd-a66a006ddb3e
 ;;; semantic/grammar.el ends here