From: Eric Ludlam Date: Sat, 20 Aug 2011 17:07:44 +0000 (-0400) Subject: Add header comments and provide. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8899bf4045cf47e293174eb07ad48e38e39c0983;p=emacs.git Add header comments and provide. --- diff --git a/test/manual/cedet/cedet/semantic/lex-utest.el b/test/manual/cedet/cedet/semantic/lex-utest.el new file mode 100644 index 00000000000..b19c376c2b6 --- /dev/null +++ b/test/manual/cedet/cedet/semantic/lex-utest.el @@ -0,0 +1,60 @@ +;;; lex-utest.el --- +;; +;; Copyright (C) 2011 Eric M. Ludlam +;; +;; Author: Eric M. Ludlam +;; +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation, either version 3 of the +;; License, or (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see http://www.gnu.org/licenses/. + + +;;; Commentary: +;; +;; + +;;; Code: + +(defun semantic-lex-test-full-depth (arg) + "Test the semantic lexer in the current buffer parsing through lists. +Usually the lexer parses +If universal argument ARG, then try the whole buffer." + (interactive "P") + (let* ((start (current-time)) + (result (semantic-lex + (if arg (point-min) (point)) + (point-max) + 100)) + (end (current-time))) + (message "Elapsed Time: %.2f seconds." + (semantic-elapsed-time start end)) + (pop-to-buffer "*Lexer Output*") + (require 'pp) + (erase-buffer) + (insert (pp-to-string result)) + (goto-char (point-min)))) + +(defun semantic-lex-test-region (beg end) + "Test the semantic lexer in the current buffer. +Analyze the area between BEG and END." + (interactive "r") + (let ((result (semantic-lex beg end))) + (pop-to-buffer "*Lexer Output*") + (require 'pp) + (erase-buffer) + (insert (pp-to-string result)) + (goto-char (point-min)))) + + +(provide 'cedet/semantic/lex-utest) + +;;; lex-utest.el ends here