From 671a8d654363b4249c0b1b5d3ffc27f345b9f562 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 1 Nov 2014 18:15:00 +0400 Subject: [PATCH] support nested comments in rust mode --- lib/ace/mode/rust_highlight_rules.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ace/mode/rust_highlight_rules.js b/lib/ace/mode/rust_highlight_rules.js index 1a7d38a6..422e8e80 100644 --- a/lib/ace/mode/rust_highlight_rules.js +++ b/lib/ace/mode/rust_highlight_rules.js @@ -127,10 +127,14 @@ var RustHighlightRules = function() { regex: '$', next: 'pop' }, { defaultToken: 'comment.line.double-dash.source.rust' } ] }, - { token: 'comment.block.source.rust', + { token: 'comment.start.block.source.rust', regex: '/\\*', + stateName: 'comment', push: - [ { token: 'comment.block.source.rust', + [ { token: 'comment.start.block.source.rust', + regex: '/\\*', + push: 'comment' }, + { token: 'comment.end.block.source.rust', regex: '\\*/', next: 'pop' }, { defaultToken: 'comment.block.source.rust' } ] } ],