Dale Sedivec | 4 Aug 2012 21:42

[PATCH] Fix Python parsing for triple-quoted strings

Greetings,

	Below is a patch to correct Semantic's parsing of Python's 
triple-quoted strings, such as '''foo''' and """foo""".  I write Python 
for my day job and I've been using this patch for over a year with 
success.

	I actually tried to submit this last year, but I needed to get my 
copyright assignment filed with the FSF.  I've now got that filed.

	These changes were originally necessary because python.el in Emacs <= 
23 used font-lock-syntactic-keywords to parse triple-quoted strings, 
which Semantic switches off during parsing.  I figured Emacs 24 and 
syntax-propertize-function would have made these changes unnecessary, 
since Semantic _presumably_ lets syntax-propertize-function run. 
However, if I just run my cedet-utests.el changes in Emacs 24 with CEDET 
HEAD, I still get a test failure, so I guess these changes are still 
necessary.

	Patch below against what is probably CEDET HEAD (taken from 
https://github.com/emacsmirror/cedet).

Thanks,
Dale

commit c9e7a2c7ca9f3a24efb7dc5d22806ac0e8e9933f
Date:   Fri Mar 18 16:12:00 2011 -0500

     wisent-python-forward-line and -string work despite hairy strings.

(Continue reading)

Eric M. Ludlam | 7 Aug 2012 04:13
Picon
Gravatar

Re: [PATCH] Fix Python parsing for triple-quoted strings

Hi Dale, thanks for patch for python support.

I'm not a python user, so I don't have comments on the patch.

Have you signed papers to assign copyright of changes you make to Emacs 
to the FSF?

   In order for me to include your patch in CEDET proper, you will need 
to assign copyright.  I've attached the form you fill out, and mail to 
fsf-records <at> gnu.org when you are done.

   I can generally accept small patches without an assignment, but your 
patch is significant enough to need an assignment.

Thanks!
Eric

On 08/04/2012 03:42 PM, Dale Sedivec wrote:
> Greetings,
>
> 	Below is a patch to correct Semantic's parsing of Python's
> triple-quoted strings, such as '''foo''' and """foo""".  I write Python
> for my day job and I've been using this patch for over a year with
> success.
>
> 	I actually tried to submit this last year, but I needed to get my
> copyright assignment filed with the FSF.  I've now got that filed.
>
> 	These changes were originally necessary because python.el in Emacs<=
> 23 used font-lock-syntactic-keywords to parse triple-quoted strings,
(Continue reading)

Eric M. Ludlam | 30 Aug 2012 03:06
Picon
Gravatar

Re: [PATCH] Fix Python parsing for triple-quoted strings

On 08/04/2012 03:42 PM, Dale Sedivec wrote:
> Greetings,
>
> 	Below is a patch to correct Semantic's parsing of Python's
> triple-quoted strings, such as '''foo''' and """foo""".  I write Python
> for my day job and I've been using this patch for over a year with
> success.

Hi Dale,

Sorry for the slow response.

I had a little trouble getting the patch merged in, but I was able to 
get it working, and your tests passed nicely.  Thanks for updating both 
the code and tests!

Eric

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

Gmane