vedm | 2 May 2006 16:11
Favicon

Re: xrefdb/semantic overlay bug

David PONCE <david.ponce <at> wanadoo.fr> writes:

[..]

> You're right.  So I took a few time to works on that ;-) And, below is
> a patch :-) It would be nice If some Java developer could try it (I
> don't program much in Java now).

Hi, I applied the patch but I still get incorrect results in the test
that I described in my initial email. In fact now it is a bit worse,
because I get an incorrect result both when I use "String[] args" and
"String args[]" - in both cases semantic incorrectly shows that the
argument is of type "String" instead of "String[]".

--

-- 
vedm

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
David Ponce | 4 May 2006 10:53
Picon

Re: Re: xrefdb/semantic overlay bug

[...]
 > Hi, I applied the patch but I still get incorrect results in the test
 > that I described in my initial email. In fact now it is a bit worse,
 > because I get an incorrect result both when I use "String[] args" and
 > "String args[]" - in both cases semantic incorrectly shows that the
 > argument is of type "String" instead of "String[]".

Hi,

Thanks for testing!

It is expected that in both cases you get type "String".  As requested
by Eric, the array dimension is now stored in the :dereference
attribute of the tag, like for C/C++.  It is the responsibility of the
programmer to interpret that attribute.

You can use the new function `semantic-java-type' in semantic-java to
get the tag type with the correct array suffix, that is "String[]" in
your example.

Sincerely,
David

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Eric M. Ludlam | 4 May 2006 13:58
Gravatar

Re[2]: xrefdb/semantic overlay bug

>>> David Ponce <david.ponce <at> wanadoo.fr> seems to think that:
>[...]
> > Hi, I applied the patch but I still get incorrect results in the test
> > that I described in my initial email. In fact now it is a bit worse,
> > because I get an incorrect result both when I use "String[] args" and
> > "String args[]" - in both cases semantic incorrectly shows that the
> > argument is of type "String" instead of "String[]".
>
>Hi,
>
>Thanks for testing!
>
>It is expected that in both cases you get type "String".  As requested
>by Eric, the array dimension is now stored in the :dereference
>attribute of the tag, like for C/C++.  It is the responsibility of the
>programmer to interpret that attribute.
>
>You can use the new function `semantic-java-type' in semantic-java to
>get the tag type with the correct array suffix, that is "String[]" in
>your example.
  [ ... ]

Hi,

  The function `semantic-java-type' seems like something that would be
useful in semantic-format.el as an override function.  The code in
semantic-format.el that will construct the needed text is duplicated
in a couple spots.  This seems like a useful discovery that could make
that semantic-format API more useful.

(Continue reading)

klaus.berndl | 4 May 2006 16:39
Picon

better and more robust interrupting of long lasting code?!

Hi,
 
You said, that cause of some mysterious (at least currently ;-) problems a semantic-parse-run is not interruptable by keypress (so here the interruptable idle-stuff does not work correctly - right?
 
In the meanwhile the new macro `while-no-input' of the current Emacs 22 CVS (subr.el) is stable and works well on all platforms. maybe using this macro instead of your own `semantic-exit-on-input' would fix this problem?! do not know but just a hint....
 
As a sideeffect using this new macro could produce cleaner code, because you are not resonsable on calling stuff like `semantic-throw-on-input'.. just place your code within `while-no-input' and bob will be your uncle....
 
disadvantage: Not available in XEmacs...:-(
 
Ciao,
Klaus
 
David Ponce | 4 May 2006 20:16
Picon

Re: xrefdb/semantic overlay bug

Hi Eric,

[...]
>> You can use the new function `semantic-java-type' in semantic-java to
>> get the tag type with the correct array suffix, that is "String[]" in
>> your example.
[...]
>   The function `semantic-java-type' seems like something that would be
> useful in semantic-format.el as an override function.  The code in
> semantic-format.el that will construct the needed text is duplicated
> in a couple spots.  This seems like a useful discovery that could make
> that semantic-format API more useful.

I agree.  Would you suggest to use the already existing overload
`semantic-format-tag-type'?  Or a new array-specific function?

The former could be a good candidate.  However it seems that the other
format functions append the array suffix to the tag name, not the tag type.
I am not sure what notation should be used in C/C++: "int i[]", or "int[] i".
In Java, it seems that the latter is the preferred one.

Any advice?

Thanks
David

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
vedm | 8 May 2006 21:20
Favicon

Re: xrefdb/semantic overlay bug


OK, seems that this is fixed: I applied the patch below in David's email
and then substituted semantic-java-type for semantic-token-type only in
one place in the function jde-xref-class-and-token-to-signature:

So this is the original form in jde-xref-class-and-token-to-signature:

(if (eq tclass 'function)
              (mapcar (lambda (arg)
                        (jde-parse-get-unqualified-name
                         (semantic-token-type arg)))
                      (semantic-token-function-args token))
            (list (jde-parse-get-unqualified-name ttype)))

and this is how I modified it (the only difference being the 4th line):

(if (eq tclass 'function)
              (mapcar (lambda (arg)
                        (jde-parse-get-unqualified-name
                         (semantic-java-type arg)))
                      (semantic-token-function-args token))
            (list (jde-parse-get-unqualified-name ttype)))

After this I get a correct result and jde-xref-display-call-tree
displays the correct call tree.

Thanks David!

--
vedm

David PONCE <david.ponce <at> wanadoo.fr> writes:

> Hi Eric,
>
> Sorry for this late reply.
>
> [...]
>>   I don't know enough of Java to know if:
>> 
>> String[] args
>> 
>>  is different from
>> 
>> String args[]
>
> There is no difference.  It seems that the first notation is the
> one used in most of the examples in the "Java Language Specifications"
> manual.
>
> Also notice that "String[] args[]" is allowed and equivalent to
> "String[][] args" or "String args[][]"! 
>
>>  but either way, these [] could be stored as attributes on the tag,
>>  and then exposed later by whatever java specific function is needed
>>  to do the query described below.
>> 
>>  In the c/c++ these are stored in a :dereference attribute, and later
>>  extracted, and the [] are put in a consistent place.
>
> You're right.  So I took a few time to works on that ;-) And, below is
> a patch :-) It would be nice If some Java developer could try it (I
> don't program much in Java now).
>
> wisent-java-tags is used to parse Java <=1.4 declarations (the
> default), wisent-java is used to fully parse Java 1.5 syntax.  To
> enable the latter, add the following after loading cedet:
>
> ;; Use the full Java 1.5 grammar to parse Java files
> (autoload 'wisent-java-default-setup "wisent-java"
>   "Hook run to setup Semantic in `java-mode'." nil nil)
>
> I updated the prototyping functions in semantic-java to restore the
> array notation (that suffixes the type) from the :dereference
> attribute.
>
> Please tell me if you want I commit these changes before the release.
>
> Enjoy!
> David
>
> 2006-04-19  David Ponce  <david <at> dponce.com>
>
> 	* cedet/semantic/bovine/semantic-java.el
>
> 	(semantic-java-dim, semantic-java-expand-tag): New functions.
> 	(semantic-java-type): New function.
> 	(semantic-java-prototype-function)
> 	(semantic-java-prototype-variable): Use it.
> 	
> 	* cedet/semantic/wisent/wisent-java.el	
> 	* cedet/semantic/wisent/wisent-java-tags.el
>
> 	(wisent-java-expand-tag): Remove.
> 	(wisent-java-default-setup): Use `semantic-java-expand-tag'.
>
> Index: bovine/semantic-java.el
> ===================================================================
> RCS file: /cvsroot/cedet/cedet/semantic/bovine/semantic-java.el,v
> retrieving revision 1.12
> diff -u -r1.12 semantic-java.el
> --- bovine/semantic-java.el	30 Sep 2005 20:22:22 -0000	1.12
> +++ bovine/semantic-java.el	19 Apr 2006 09:49:26 -0000
>  <at>  <at>  -1,6 +1,7  <at>  <at> 
>  ;;; semantic-java.el --- Semantic functions for Java
>  
> -;;; Copyright (C) 1999, 2000, 2001, 2002, 2003 David Ponce
> +;;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
> +;;;   David Ponce
>  
>  ;; Author: David Ponce <david <at> dponce.com>
>  ;; X-RCS: $Id: semantic-java.el,v 1.12 2005/09/30 20:22:22 zappo Exp $
>  <at>  <at>  -35,7 +36,6  <at>  <at> 
>  
>  ;;; Lexical analysis
>  ;;
> -
>  (defconst semantic-java-number-regexp
>    (eval-when-compile
>      (concat "\\("
>  <at>  <at>  -83,6 +83,65  <at>  <at> 
>    | [0-9]+<EXPONENT>?[fFdD]
>    ;")
>  
> +;;; Parsing
> +;;
> +(defsubst semantic-java-dim (id)
> +  "Split ID string into a pair (NAME . DIM).
> +NAME is ID without trailing brackets: \"[]\".
> +DIM is the dimension of NAME deduced from the number of trailing
> +brackets, or 0 if there is no trailing brackets."
> +  (let ((dim (string-match "\\(\\[]\\)+\\'" id)))
> +    (if dim
> +        (cons (substring id 0 dim)
> +              (/ (length (match-string 0 id)) 2))
> +      (cons id 0))))
> +
> +(defsubst semantic-java-type (tag)
> +  "Return the type of TAG, taking care of array notation."
> +  (let ((type (semantic-tag-type tag))
> +        (dim  (semantic-tag-get-attribute tag :dereference)))
> +    (when dim
> +      (while (> dim 0)
> +        (setq type (concat type "[]")
> +              dim (1- dim))))
> +    type))
> +
> +(defun semantic-java-expand-tag (tag)
> +  "Expand compound declarations found in TAG into separate tags.
> +TAG contains compound declarations when its class is `variable', and
> +its name is a list of elements (NAME START . END), where NAME is a
> +compound variable name, and START/END are the bounds of the
> +corresponding compound declaration."
> +  (let* ((class (semantic-tag-class tag))
> +         (elts (semantic-tag-name tag))
> +         dim dim0 elt clone start end xpand)
> +    (cond
> +     ((and (eq class 'function)
> +           (> (cdr (setq dim (semantic-java-dim elts))) 0))
> +      (setq clone (semantic-tag-clone tag (car dim))
> +            xpand (cons clone xpand))
> +      (semantic-tag-put-attribute clone :dereference (cdr dim)))
> +     ((eq class 'variable)
> +      (or (consp elts) (setq elts (list (list elts))))
> +      (setq dim  (semantic-java-dim (semantic-tag-get-attribute tag :type))
> +            type (car dim)
> +            dim0 (cdr dim))
> +      (while elts
> +        ;; For each compound element, clone the initial tag with the
> +        ;; name and bounds of the compound variable declaration.
> +        (setq elt   (car elts)
> +              elts  (cdr elts)
> +              start (if elts  (cadr elt) (semantic-tag-start tag))
> +              end   (if xpand (cddr elt) (semantic-tag-end   tag))
> +              dim   (semantic-java-dim (car elt))
> +              clone (semantic-tag-clone tag (car dim))
> +              xpand (cons clone xpand))
> +        (semantic-tag-put-attribute clone :type type)
> +        (semantic-tag-put-attribute clone :dereference (+ dim0 (cdr dim)))
> +        (semantic-tag-set-bounds clone start end)))
> +     )
> +    xpand))
> +
>  ;;; Environment
>  ;;
>  
>  <at>  <at>  -103,7 +162,7  <at>  <at> 
>  Optional argument COLOR indicates that color should be mixed in.
>  See also `semantic-format-prototype-tag'."
>    (let ((name (semantic-tag-name tag))
> -        (type (semantic-tag-type tag))
> +        (type (semantic-java-type tag))
>          (args (semantic-tag-function-arguments tag))
>          (argp "")
>          arg argt)
>  <at>  <at>  -113,8 +172,8  <at>  <at> 
>        (if (semantic-tag-p arg)
>            (setq argt (if color
>                           (semantic--format-colorize-text
> -                          (semantic-tag-type arg) 'type)
> -                       (semantic-tag-type arg))
> +                          (semantic-java-type arg) 'type)
> +                       (semantic-java-type arg))
>                  argp (concat argp argt (if args "," "")))))
>      (if color
>          (progn
>  <at>  <at>  -130,8 +189,8  <at>  <at> 
>  See also `semantic-format-prototype-tag'."
>    (concat (if color
>                (semantic--format-colorize-text
> -               (semantic-tag-type tag) 'type)
> -            (semantic-tag-type tag))
> +               (semantic-java-type tag) 'type)
> +            (semantic-java-type tag))
>            " "
>            (if color
>                (semantic--format-colorize-text
> Index: wisent/wisent-java-tags.el
> ===================================================================
> RCS file: /cvsroot/cedet/cedet/semantic/wisent/wisent-java-tags.el,v
> retrieving revision 1.31
> diff -u -r1.31 wisent-java-tags.el
> --- wisent/wisent-java-tags.el	30 Sep 2005 20:25:20 -0000	1.31
> +++ wisent/wisent-java-tags.el	19 Apr 2006 09:49:31 -0000
>  <at>  <at>  -1,6 +1,6  <at>  <at> 
>  ;;; wisent-java-tags.el --- Java LALR parser for Emacs
>  
> -;; Copyright (C) 2001, 2002 David Ponce
> +;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 David Ponce
>  
>  ;; Author: David Ponce <david <at> dponce.com>
>  ;; Maintainer: David Ponce <david <at> dponce.com>
>  <at>  <at>  -96,7 +96,7  <at>  <at> 
>     semantic-lex-number-expression semantic-java-number-regexp
>     semantic-lex-analyzer 'wisent-java-tags-lexer
>     ;; Parsing
> -   semantic-tag-expand-function 'wisent-java-expand-tag
> +   semantic-tag-expand-function 'semantic-java-expand-tag
>     ;; Environment
>     semantic-imenu-summary-function 'semantic-format-tag-prototype
>     imenu-create-index-function 'semantic-create-imenu-index
>  <at>  <at>  -122,32 +122,8  <at>  <at> 
>    ;; Setup javadoc stuff
>    (semantic-java-doc-setup))
>  
> -(defun wisent-java-expand-tag (tag)
> -  "Expand TAG into a list of equivalent tags, or nil.
> -Expand multiple variable declarations in the same statement, that is
> -tags of class `variable' whose name is equal to a list of elements of
> -the form (NAME START . END).  NAME is a variable name.  START and END
> -are the bounds in the declaration, related to this variable NAME."
> -  (let (elts elt clone start end xpand)
> -    (when (and (eq 'variable (semantic-tag-class tag))
> -               (consp (setq elts (semantic-tag-name tag))))
> -      ;; There are multiple names in the same variable declaration.
> -      (while elts
> -        ;; For each name element, clone the initial tag and give it
> -        ;; the name of the element.
> -        (setq elt   (car elts)
> -              elts  (cdr elts)
> -              clone (semantic-tag-clone tag (car elt))
> -              start (if elts  (cadr elt) (semantic-tag-start tag))
> -              end   (if xpand (cddr elt) (semantic-tag-end   tag))
> -              xpand (cons clone xpand))
> -        ;; Set the bounds of the cloned tag with those of the name
> -        ;; element.
> -        (semantic-tag-set-bounds clone start end))
> -      xpand)))
> -
>  ;;;###autoload
> -(add-hook 'java-mode-hook #'wisent-java-default-setup)
> +(add-hook 'java-mode-hook 'wisent-java-default-setup)
>  
>  (provide 'wisent-java-tags)
>  
> Index: wisent/wisent-java.el
> ===================================================================
> RCS file: /cvsroot/cedet/cedet/semantic/wisent/wisent-java.el,v
> retrieving revision 1.48
> diff -u -r1.48 wisent-java.el
> --- wisent/wisent-java.el	30 Sep 2005 20:25:17 -0000	1.48
> +++ wisent/wisent-java.el	19 Apr 2006 09:49:31 -0000
>  <at>  <at>  -1,6 +1,6  <at>  <at> 
>  ;;; wisent-java.el --- Java LALR parser for Emacs
>  
> -;; Copyright (C) 2001, 2002 David Ponce
> +;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 David Ponce
>  
>  ;; Author: David Ponce <david <at> dponce.com>
>  ;; Maintainer: David Ponce <david <at> dponce.com>
>  <at>  <at>  -45,27 +45,6  <at>  <at> 
>  
>  ;;; Enable Semantic in `java-mode'.
>  ;;
> -(defun wisent-java-expand-tag (tag)
> -  "Expand compound declarations found in TAG into separate tags.
> -TAG contains compound declarations when its class is `variable', and
> -its name is a list of elements (NAME START . END), where NAME is a
> -compound variable name, and START/END are the bounds of the
> -corresponding compound declaration."
> -  (let (elts elt clone start end xpand)
> -    (when (and (semantic-tag-of-class-p tag 'variable)
> -               (consp (setq elts (semantic-tag-name tag))))
> -      (while elts
> -        ;; For each compound element, clone the initial tag with the
> -        ;; name and bounds of the compound variable declaration.
> -        (setq elt   (car elts)
> -              elts  (cdr elts)
> -              start (if elts  (cadr elt) (semantic-tag-start tag))
> -              end   (if xpand (cddr elt) (semantic-tag-end   tag))
> -              clone (semantic-tag-clone tag (car elt))
> -              xpand (cons clone xpand))
> -        (semantic-tag-set-bounds clone start end))
> -      xpand)))
> -
>  (defun wisent-java-init-parser-context ()
>    "Initialize context of the LR parser engine.
>  Used as a local `wisent-pre-parse-hook' to cleanup the stack of enum
>  <at>  <at>  -85,7 +64,7  <at>  <at> 
>     semantic-lex-depth nil
>     semantic-lex-analyzer 'wisent-java-lexer
>     ;; Parsing
> -   semantic-tag-expand-function 'wisent-java-expand-tag
> +   semantic-tag-expand-function 'semantic-java-expand-tag
>     ;; Environment
>     semantic-imenu-summary-function 'semantic-format-tag-prototype
>     semantic-imenu-expandable-tag-classes '(type variable)
>
>
>
>

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
klaus.berndl | 16 May 2006 16:12
Picon

Change in the format-functions between beta3 and current CVS?

Hi,
 
can you give me a short pointer what has been changed between cedet-1.0beta3b and current CVS of cedet concerning the format-functions?
 
fact is with cedet-1.0beta3b ECB displays elisp-methods with function-args and with current CVS not:
 
cedet-1.0beta3b: (ecb-analyse-compare-node-data left right)
current-CVS-snapshot: (ecb-analyse-compare-node-data ) (note the single space here)
 
Thanks a lot,
Klaus
 
Klaus Berndl                     mailto: klaus.berndl <at> sdm.de
sd&m AG                         http://www.sdm.de
software design & management
Carl-Wery-Str. 42, 81739 Muenchen, Germany
Tel +49 89 63812-392, Fax -220
 
klaus.berndl | 18 May 2006 17:36
Picon

problems with current CVS-content of cedet!!

Hi Guys,
 
shortly i received an email from SF that all CVS-repositories have been relocated - i think xyou got this email too...
 
After that i have followed the instructions of SF and have checked out cedet again with the following new syntax:
 
cvs -d:ext:berndl <at> cedet.cvs.sourceforge.net:/cvsroot/cedet co cedet
 
This working dir i have compiled and i got problems with the semantic-format-functions - one example:
 
This is the code of semantic--format-tag-arguments contained in beta3 (which is working)
 
(defun semantic--format-tag-arguments (args formatter color)
  "Format the argument list ARGS with FORMATTER.
FORMATTER is a function used to format a tag.
COLOR specifies if color should be used."
  (let ((out nil))
    (while args
      (cond ((stringp (car args))
      (let ((a (car args)))
        (if color
     (setq a (semantic--format-colorize-text a 'variable)))
        (setq out (cons a out))
        ))
     ((semantic-tag-p (car args))
      (setq out
     (cons (funcall formatter (car args) nil color)
    out))))
      (setq args (cdr args)))
    (mapconcat 'identity (nreverse out) semantic-function-argument-separator)
    ))
 
This is the code i got aftre checking out cedet again - s.a.: . which is not working:
 
(defun semantic--format-tag-arguments (args formatter color)
  "Format the argument list ARGS with FORMATTER.
FORMATTER is a function used to format a tag.
COLOR specifies if color should be used."
  (let ((out nil))
    (while args
      (semantic-format-tag-name-from-anything (car args) nil color 'variable)
      (setq args (cdr args)))
    (mapconcat 'identity (nreverse out) semantic-function-argument-separator)
    ))
 
which is obviously a non working version of this function......for me this seems to be uch older than the version contained in beta3 of cedet but how can this be when i check out a new working dir of current cedet-CVS???
 
my question: What should i do to get again all current(!!) sources of cedet?
 
Thanks for your help!
 
Ciao,
klaus
 
Klaus Berndl                     mailto: klaus.berndl <at> sdm.de
sd&m AG                         http://www.sdm.de
software design & management
Carl-Wery-Str. 42, 81739 Muenchen, Germany
Tel +49 89 63812-392, Fax -220
 
David Ponce | 18 May 2006 19:40
Picon

Re: problems with current CVS-content of cedet!!

Hi Klaus,

[...]
> This is the code of semantic--format-tag-arguments contained in beta3 
> (which is working)
>  
> (defun semantic--format-tag-arguments (args formatter color)
>   "Format the argument list ARGS with FORMATTER.
> FORMATTER is a function used to format a tag.
> COLOR specifies if color should be used."
>   (let ((out nil))
>     (while args
>       (cond ((stringp (car args))
>       (let ((a (car args)))
>         (if color
>      (setq a (semantic--format-colorize-text a 'variable)))
>         (setq out (cons a out))
>         ))
>      ((semantic-tag-p (car args))
>       (setq out
>      (cons (funcall formatter (car args) nil color)
>     out))))
>       (setq args (cdr args)))
>     (mapconcat 'identity (nreverse out) 
> semantic-function-argument-separator)
>     ))
>  
> This is the code i got aftre checking out cedet again - s.a.: . which is 
> not working:
>  
> (defun semantic--format-tag-arguments (args formatter color)
>   "Format the argument list ARGS with FORMATTER.
> FORMATTER is a function used to format a tag.
> COLOR specifies if color should be used."
>   (let ((out nil))
>     (while args
>       (semantic-format-tag-name-from-anything (car args) nil color 
> 'variable)
>       (setq args (cdr args)))
>     (mapconcat 'identity (nreverse out) 
> semantic-function-argument-separator)
>     ))
>  
> which is obviously a non working version of this function......for me 
> this seems to be uch older than the version contained in beta3 of cedet 
> but how can this be when i check out a new working dir of current 
> cedet-CVS???
[...]

The version you checked out is the good one (1.20).  Unfortunately, I
don't remember why Eric did these changes since:

revision 1.19
date: 2005/09/01 00:10:32;  author: zappo;  state: Exp;  lines: +81 -18
(semantic-format-tag-functions): Add semantic-format-tag-canonical-name.
(semantic-format-parent-separator): New option.
(semantic--format-tag-arguments): Use below fcn
(semantic-format-tag-name-from-anything): New function (from above)
(semantic--format-tag-parent-tree): New unfinished function.
(semantic-format-tag-canonical-name): New overload function.
(semantic-format-tag-abbreviate-default): Use above.

Anyway you're right the code doesn't look good.
Please, could you try this version, and tell me if it works (untested):

(defun semantic--format-tag-arguments (args formatter color)
   "Format the argument list ARGS with FORMATTER.
FORMATTER is a function used to format a tag.
COLOR specifies if color should be used."
   (let ((out nil))
     (while args
       (push (semantic-format-tag-name-from-anything
              (car args) nil color 'variable) out)
       (setq args (cdr args)))
     (mapconcat 'identity (nreverse out) semantic-function-argument-separator)
     ))

David

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
klaus.berndl | 19 May 2006 09:31
Picon

RE: problems with current CVS-content of cedet!!

Hi David,

i would assume that your new version would work because now the "out" variable is set.
But i still wonder if this is the right version because the argument FORMATTER is not used.
In the beta3-version it is used?!

Klaus

David Ponce wrote:
> Hi Klaus,
> 
> [...]
>> This is the code of semantic--format-tag-arguments contained in
>> beta3 (which is working) 
>> 
>> (defun semantic--format-tag-arguments (args formatter color)
>>   "Format the argument list ARGS with FORMATTER.
>> FORMATTER is a function used to format a tag.
>> COLOR specifies if color should be used."
>>   (let ((out nil))
>>     (while args
>>       (cond ((stringp (car args))
>>       (let ((a (car args)))
>>         (if color
>>      (setq a (semantic--format-colorize-text a 'variable)))
>>         (setq out (cons a out))
>>         ))
>>      ((semantic-tag-p (car args))
>>       (setq out
>>      (cons (funcall formatter (car args) nil color)     out))))
>>       (setq args (cdr args)))
>>     (mapconcat 'identity (nreverse out)
>> semantic-function-argument-separator)
>>     ))
>> 
>> This is the code i got aftre checking out cedet again - s.a.: .
>> which is not working: 
>> 
>> (defun semantic--format-tag-arguments (args formatter color)
>>   "Format the argument list ARGS with FORMATTER.
>> FORMATTER is a function used to format a tag.
>> COLOR specifies if color should be used."
>>   (let ((out nil))
>>     (while args
>>       (semantic-format-tag-name-from-anything (car args) nil color
>>       'variable) (setq args (cdr args)))
>>     (mapconcat 'identity (nreverse out)
>> semantic-function-argument-separator)
>>     ))
>> 
>> which is obviously a non working version of this function......for me
>> this seems to be uch older than the version contained in beta3 of
>> cedet but how can this be when i check out a new working dir of
>> current cedet-CVS???
> [...]
> 
> The version you checked out is the good one (1.20).  Unfortunately, I
> don't remember why Eric did these changes since:
> 
> revision 1.19
> date: 2005/09/01 00:10:32;  author: zappo;  state: Exp;  lines: +81
> -18 (semantic-format-tag-functions): Add
> semantic-format-tag-canonical-name.
> (semantic-format-parent-separator): New option.
> (semantic--format-tag-arguments): Use below fcn
> (semantic-format-tag-name-from-anything): New function (from above)
> (semantic--format-tag-parent-tree): New unfinished function.
> (semantic-format-tag-canonical-name): New overload function.
> (semantic-format-tag-abbreviate-default): Use above. 
> 
> Anyway you're right the code doesn't look good.
> Please, could you try this version, and tell me if it works
> (untested): 
> 
> (defun semantic--format-tag-arguments (args formatter color)
>    "Format the argument list ARGS with FORMATTER.
> FORMATTER is a function used to format a tag.
> COLOR specifies if color should be used."
>    (let ((out nil))
>      (while args
>        (push (semantic-format-tag-name-from-anything
>               (car args) nil color 'variable) out)
>        (setq args (cdr args)))
>      (mapconcat 'identity (nreverse out)
>      semantic-function-argument-separator) ))
> 
> 
> David
> 
> 
> 
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services,
> security? 
> Get stuff done quickly with pre-integrated technology to make your
> job easier Download IBM WebSphere Application Server v.1.0.1 based on
> Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________ 
> Cedet-devel mailing list
> Cedet-devel <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/cedet-devel

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642

Gmane