Subject: bug#63708: 29.0.60; rust-ts-mode not properly handling apostrophe

From: Randy Taylor <[email-masked]>
Date: Sat, 27 May 2023 03:00:09 +0000

On Friday, May 26th, 2023 at 15:14, Йордан Миладинов <[email-masked]> wrote:
> Here's a patch that implements Randy's idea.
> 

Thanks for working on this!

This fix is indeed what I had in mind and I see that you also fixed another bug, thanks!
Eli, the changes to the existing loop are needed to apply the correct syntax properties
to type_parameters, which were previously incorrectly considered punctuation.
I think this is the safest fix for Emacs 29.

I have some other comments about the patch below.

+      (put-text-property (match-beginning 0)
+                         (match-end 0)
+                         'syntax-table
+                         '(7))))
                           ^^^
                           Do we want to use string-to-syntax here?

-  "Apply syntax text property to template delimiters between BEG and END.
+  "Apply proper syntax properties to various special characters with
+double meaning in Rust code between BEG and END.

Maybe "Apply syntax properties to various special characters with contextual meaning between BEG and END."?

-< and > are usually punctuation, e.g., as greater/less-than.  But
-when used for types, they should be considered pairs.
+Apostrophe (') is commonly treated as punctuation, but when used
+to define character literals, it should be treated as a string.

Maybe "Apostrophes (') are commonly treated as punctuation, but when used to define character literals, they should be treated as strings."?