Re: [cedet-semantic] [PATCH] Tests for Python imports
Brought to you by:
zappo
From: Eric M. L. <eri...@gm...> - 2012-02-11 14:43:16
|
Hi, I don't know enough about python to know if it is good to remove the code tag or not. I do know that there is no support in CEDET for "CODE" like tags in general as they are not used in the languages that have the most support. For Python, the code tags could be used for local context parsing or some other features. Perhaps one of the other python users / CEDET developers on the list might know? Eric On 02/06/2012 06:14 PM, Thomas Bach wrote: > Hi there, > > here is a diff that adds a test for one flavour of the Python import > statement. The test doesn't pass without tweaking on python.wy. I came > to the conclusion that `(CODE-TAG $1 nil)' could be safely removed. As > far as I see it, the only useful thing it covers are sole function > calls and its not very good in that. Hence the to-do item: ‘Add rule for > function calls’. > > Anyway, I'm not very sure if this information is processed by > semantic. What does semantic do with the information that function a is > called? > > Regards, > vince > > > === modified file 'semantic/semantic-ia-utest.el' > --- semantic/semantic-ia-utest.el 2011-08-07 02:00:48 +0000 > +++ semantic/semantic-ia-utest.el 2012-02-05 16:50:29 +0000 > @@ -52,6 +52,7 @@ > "tests/testvarnames.c" > "tests/testjavacomp.java" > "tests/testf90.f90" > + "tests/testpyimports.py" > ) > "List of files with analyzer completion test points.") > > > === added file 'semantic/tests/testpyimports.py' > --- semantic/tests/testpyimports.py 1970-01-01 00:00:00 +0000 > +++ semantic/tests/testpyimports.py 2012-02-06 22:46:26 +0000 > @@ -0,0 +1,7 @@ > +# -*- coding: utf-8 -*- > + > +import test1_foo > +import test1_bar > + > +test1_# -1- > +# #1# ("test1_foo" "test1_bar") > > === modified file 'semantic/wisent/wisent-python.el' > --- semantic/wisent/wisent-python.el 2012-01-29 14:53:58 +0000 > +++ semantic/wisent/wisent-python.el 2012-02-05 18:06:44 +0000 > @@ -434,14 +434,13 @@ > "Setup buffer for parse." > (wisent-python-wy--install-parser) > (set (make-local-variable 'parse-sexp-ignore-comments) t) > + ;; This variable is missing in python.el > + (if (not comment-start-skip) > + (set (make-local-variable 'comment-start-skip) "#+\\s-*")) > (setq > ;; Character used to separation a parent/child relationship > semantic-type-relation-separator-character '(".") > semantic-command-separation-character ";" > - ;; The following is no more necessary as semantic-lex is overriden > - ;; in python-mode. > - ;; semantic-lex-analyzer 'wisent-python-lexer > - > ;; Semantic to take over from the one provided by python. > ;; The python one, if it uses the senator advice, will hang > ;; Emacs unrecoverably. > > === modified file 'semantic/wisent/wisent-python.wy' > --- semantic/wisent/wisent-python.wy 2011-08-03 00:34:31 +0000 > +++ semantic/wisent/wisent-python.wy 2012-02-06 22:50:00 +0000 > @@ -85,6 +85,7 @@ > ;;; To do: > ;; > ;; * Verify that semantic-lex-python-number regexp is correct. > +;; * Add rule for function calls > > ;; -------- > ;; Settings > @@ -404,8 +405,7 @@ > (if (and $2 (stringp $1) (string-match "^\\(\\sw\\|\\s_\\)+$" $1)) > ;; If this is an assignment statement and left side is a symbol, > ;; then generate a 'variable token, else return 'code token. > - (VARIABLE-TAG $1 nil nil) > - (CODE-TAG $1 nil)) > + (VARIABLE-TAG $1 nil nil)) > ; > > ;; Could be EMPTY because of eq_testlist_zom. > > > ------------------------------------------------------------------------------ > Try before you buy = See our experts in action! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-dev2 > _______________________________________________ > cedet-semantic mailing list > ced...@li... > https://lists.sourceforge.net/lists/listinfo/cedet-semantic |