Bug 358692

Summary: Rust supports nested block comments
Product: [Frameworks and Libraries] frameworks-ktexteditor Reporter: mtest31
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: mtest31
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Patch to fix the bug

Description mtest31 2016-01-28 17:32:51 UTC
Rust supports nested block comments. So, a block comment doesn't end with the first "*/" sequence, but instead it counts how often "/*" had been before. [1]

Kate however doesn't support this and assumes behaviour similar to C, which doesn't have nested block comments. As an example, take the code at [2], and copy it into kate, setting the format to "Rust". It won't highlight the first "main" function as comment, even though it should (and the format [2] even does).

[1]: https://doc.rust-lang.org/reference.html#comments
[2]: https://play.rust-lang.org/?gist=50645e9b3c25b92d59ed&version=stable

I haven't checked the latest version of Kate, my version is 15.08.2 (KDE Frameworks 5.15.0), but from git log src/syntax/data/rust.xml I can see there hasn't been any change of the rust format file since may 2015, and the commit at the v5.15.0 tag is more recent.
Comment 1 mtest31 2016-01-30 21:38:07 UTC
Created attachment 96933 [details]
Patch to fix the bug

I've attached a patch with the fix.
Comment 2 mtest31 2016-01-30 21:40:43 UTC
Does this also require a bump of the xml's version? I'm not sure.
Comment 3 Eike Hein 2016-03-07 07:22:38 UTC
Git commit 366d4d5ce1b8aee62c2214304f1c165955ba3f0b by Eike Hein, on behalf of est 31.
Committed on 07/03/2016 at 07:22.
Pushed by hein into branch 'master'.

Fix nested comment blocks.

M  +1    -0    src/syntax/data/rust.xml

http://commits.kde.org/ktexteditor/366d4d5ce1b8aee62c2214304f1c165955ba3f0b