Hi Eric, Claudio and list,
I think that we can't test for existence of any files (where to
search ?) in semantic-tag-include-filename .
Probably the existence test should be done after, not in
this override-defun. An alternative could be return all two possibility
in a list like '("file.py" "file/__init__.py"), but is possible ??
semantic-tag-include-filename have to return one string ?
Maybe (i'm not sure), an other case is:
import module.Function
How to solve it ?
I don't see a simple solution. Any ideas ?
Marco
"Eric M. Ludlam" <eric@...> writes:
> Hi,
>
> Python support is still incomplete. Someone needs to add a python
> specific overload of semantic-tag-include-filename to do the correct
> text string translation. The patch below that that modifies the parser
> is a good idea, but strays from keeping the tags pristine, and could
> make the SRecoder support for python (not yet implemented) more
> challenging.
>
> There is a good example in semantic-el.el
>
> Eric
>
> On Thu, 2009-10-29 at 08:37 +0100, Claudio Bley wrote:
>> Hi.
>>
>> I'm trying to use semantic with Python. But it cannot find any imported
>> modules -- they're always listed as unknown.
>>
>> I did add the correct python library path using
>> semantic-add-system-include and also tried to configure it using
>> semantic-python-dependency-system-include-path to no avail.
>>
>> Is that actually supposed to work?
>>
>> I looked through the code but could not find a spot where a .py
>> extension is added to the module name in order to load it. It seems
>> semantic tries to load the module using just the given name and hence it
>> fails.
>>
>> I changed this in wisent-python.wy:
>>
>> @@ -483,9 +487,9 @@
>> ;; ('*' | import_as_name (',' import_as_name)*)
>> import_stmt
>> : IMPORT dotted_as_name_list
>> - (INCLUDE-TAG $2 nil)
>> + (INCLUDE-TAG (concat $2 ".py") nil)
>> | FROM dotted_name IMPORT star_or_import_as_name_list
>> - (INCLUDE-TAG $2 nil)
>> + (INCLUDE-TAG (concat $2 ".py") nil)
>> ;
>>
>> Loading of single modules now works, but I don't know whether this is
>> the right thing to do?!
>>
>> Furthermore, if one includes more modules using a single import
>> statement it won't work at all. How could this be fixed? Is it possible
>> to return a list of INCLUDE-TAG's in the action?
>>
>> Cheers,
>> Claudio
>> --
>> Claudio Bley
>> b_l_e_y@...
>>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> cedet-semantic mailing list
> cedet-semantic@...
> https://lists.sourceforge.net/lists/listinfo/cedet-semantic
|