From c6725040bd05dc3e3f1f586ce6d4abf1a0a6f315 Mon Sep 17 00:00:00 2001 From: Eric Ludlam Date: Wed, 12 Sep 2012 21:38:12 -0400 Subject: [PATCH] etc/srecode/c.srt: New file, contents from cpp.srt etc/srecode/cpp.srt: Delete parts moved to c.srt lisp/cedet/ede.el: (ede-configuration-forms-menu): Make robust to cases where there is no current project. lisp/cedet/srecode/cpp.el: (srecode-semantic-handle-:c): Renamed from the srecode-semantic-handle-:cpp. (srecode-semantic-handle-:cpp): Calls above. (c-mode::srecode-semantic-apply-tag-to-dict): Moved from a cpp-mode function to a c-mode function. Note this in doc. (srecode-c-apply-templates): Renamed from srecode-cpp-apply-templates tests/cit-cpp.el: (cit-plain-c-tags): New variable (cit-srecode-fill-cpp): Insert above into a new file as part of a new program. --- test/manual/cedet/cit-cpp.el | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/test/manual/cedet/cit-cpp.el b/test/manual/cedet/cit-cpp.el index 4ad7c1c01bd..c0ae360966b 100644 --- a/test/manual/cedet/cit-cpp.el +++ b/test/manual/cedet/cit-cpp.el @@ -1,6 +1,6 @@ ;;; cit-cpp.el --- C++ specific things for our integ test. -;; Copyright (C) 2008, 2009, 2010 Eric M. Ludlam +;; Copyright (C) 2008, 2009, 2010, 2012 Eric M. Ludlam ;; Author: Eric M. Ludlam @@ -22,6 +22,7 @@ ;;; Commentary: ;; ;; C++ specific code for the cedet integration tests. +;; Add some C code too! ;;; Code: @@ -104,6 +105,21 @@ ) "Tags to be inserted into a source file.") +(defvar cit-plain-c-tags + (list + (semantic-tag-new-include "string.h" nil) + (semantic-tag-new-function + "main" "int" + (list (semantic-tag-new-variable "argc" "int") + (semantic-tag-new-variable "argv" "char" + nil + :pointer 2 )) + :code " int myInt = 0; + char *myStr = strdup(\"MOOSE\"); +") + ) + "Tags to be inserted into plain.c.") + (defvar cit-main-cpp-tags (list (semantic-tag-new-include "foo.hpp" nil) @@ -149,6 +165,11 @@ MAKE-TYPE is the type of make process to use." ;; 1 e) Tell EDE where the srcs are (ede-add-file "Prog") + ;; Have some plain C code too to test the C code generator + (cit-srecode-fill-with-stuff "src/plain.c" cit-plain-c-tags) + (ede-new-target "Plain" "program" "n") + (ede-add-file "Plain") + (let ((p (ede-current-project))) (if (string= make-type "Automake") (oset p :variables '( ( "AM_CPPFLAGS" . "-I../include") )) -- 2.39.5