GNU bug report logs -
#63708
29.0.60; rust-ts-mode not properly handling apostrophe
Previous Next
Reported by: Йордан Миладинов <yordanm <at> proton.me>
Date: Thu, 25 May 2023 03:58:02 UTC
Severity: normal
Merged with 63709
Found in version 29.0.60
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #28 received at 63708 <at> debbugs.gnu.org (full text, mbox):
Thanks for the comments!
Here's the updated review + the same trick applied for Go as well as I discovered the same bug in go-ts-mode.
> On Saturday, May 27th, 2023 at 6:00 AM, Randy Taylor <dev <at> rjt.dev> > wrote:
>
> Do we want to use string-to-syntax here?
I believe we do as this is what both the old c-mode and the new c-ts-mode define.
If you're going to commit these fixes for both Rust and Go, would you like me to go through all native treesiter modes, check for the same bug and eventually apply the same fix?
Cheers! YM
> On Friday, May 26th, 2023 at 15:14, Йордан Миладинов yordanm <at> proton.me 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))))
> ^^^
>
>
> - "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."?
This bug report was last modified 1 year and 355 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.